Automount Drive #2

I have installed an additional SSD to my computer I would like to move my media files to it (Pictures, Music, Videos). I have formatted the drive and copied the data to it. When I restart the system it is not mounted. I'm not at all familiar with how Linux handles disks, mounting, etc..

There is an older thread with the same title and a solution but I do not understand how to apply it in my situation. The discussion is closed so I am unable to ask any further questions there.

Here is my drive properties. I would like to mount this automatically upon startup.

I named the volume "Media" and it mounted under my Home folder. I didn't see any options to choose another location. Does it matter where it's mounted?

Can someone help me with this?

Thank you much!

Disable "User session defaults".

That didn't work.

Keep "mount at system startup" and "show in user interface" enabled. Did you reboot after doing this?

Can you please take a screenshot of your mount options? What happens when you use the automatically filled out settings?
You can also mount the drive with another mountpoint than your home directory and then create a folder in your home directory that links to the drive.

To "mount" a drive simply means to make it available to the rest of the system. It doesn't matter where it's mounted as long as it makes sense to you.
With that said, there are certain standard locations that are used by default to make things a little more predictable.

For simplicity, I'd recommend leaving the defaults as they are unless you have a reason to change them. However, you can change them in the "Mount Point" field as per your screenshot above to another location that you'd like. Keep in mind that this location needs to be a folder that already exists.

According to the screenshot shown above, the drive should be mounted at /mnt, not in your home directory. This is normal and expected. The long random string is the identifier for that drive. Regardless of where it's mounted, it should show up on the sidebar, is that not the case?

To what have You formatted the Drive? NTFS? ext4?

Ok, I stand corrected. It did work however it mounted it in the /mnt folder, which it exactly where the dialog says it would be and named it that long string identifier. I was looking for it elsewhere. I have a /media folder now as well with a subfolder of my username with nothing in it. I assume this was a result of something I did.

Can I change that identifier to something that makes sense to me so I can use it to "redirect" the default locations for Pictures, Music, Videos as intended? Something like "Media" ?

The only thing I did was disable the User Default switch. I didn't change any other fields in that dialog. When formatting I chose the default file system for Linux only - ext4, not NTFS.

Here's the current disk details:

1 Like

By convention, /media/<username> is used for external devices like USB drives, CDs, etc. The /mnt location is used for more permanent set ups like internal drives. There's no difference whatsoever, it's just a matter of convention to make things a little more predictable.

You can't change the identifier itself, but that is mostly used for system utilities and whatnot, and you can give it a name that will be displayed in the file system:

Notice that, even though the actual mount point remains /mnt in this example, the displayed name updates accordingly.

As for "redirecting" the mount point... if you what you're asking is whether you can use this drive for your own home files, the best way to do that would be to mount this drive on top of /home. Is that what you're after?

1 Like

Thank you so much for all your help. I really appreciate the explanations of conventions used for folders and mounting drives.

What I'm after is to move my pictures, music, videos to the new drive in separate folders: /Music, /Pictures. /Videos right off the root of the drive if possible. Also change the links in the start menus and Files (Nautalis) if you will so that clicking those links will take me to the new locations. I've read a bit about editing the users-dir.dirs file to accomplish this. I'll probably have trouble figuring out the correct names for the new locations of those folders though. Every time I've tried to modify that file it reverts back to the default, using Nano to edit it. I assumed it was because the volume wasn't mounting on startup thus the new folders weren't present.

Bryan

In the File, You would have to take the Path to the Drive, something like:

/mnt/[The-Identifier]/Music

That should be in the File the Line:

XDG_MUSIC_DIR="/mnt/[The-Identifier]/Music"

Of Course, You would have to create a Music Folder on the Drive first. You could try it with that. Oh, and did You used the user-dirs.dirs File in ~/.config/ ?

The cleanest way would be basically turn this drive into your home folder, but mounting it on /home — or /home/<username> if you have other accounts created here that you don't want to store in the same drive.

You probably don't want to use the whole 4 TB just for this, and I'd recommend creating a dedicated partition instead. This is optional, but it will help keeping things organized and you would still be able to use the rest of the drive for other purposes. Of course, this depends on how much data you have, but you can always resize it later if needed.

The only problem with this approach is that you need to create said partition, which means formatting the drive. So, before moving on make sure that all data in that drive is properly backed up elsewhere.

Another approach is possible, but it's not as clean. It involves creating symbolic links to point to the mount point of that drive. It works, but I personally don't like it... It just feels "hacky".

That sounds like a good idea but rather complicated to me at this point. Besides I already have 1.5TB of media data going on the drive and I plan to grow the video library once I begin ripping my DVD collection.

Thank you for the suggestion though and maybe I'll do that for the next PC after I've become more comfortable with Linux.

1 Like

It sounds more complicated than it really is, but there is indeed a bit of an extra complexity to it. If you're not comfortable with the idea, then just skip it.

The alternative would then be as @Ponce-De-Leon suggested above, by just creating links (shortcuts) to the external drive. For example:

sr1

Here I'm copying some folders to the external drive, and then deleting them from the system. Create links from the drive and copy those over to replace the folders that were there before. Keep in mind that the "Desktop", "Downloads" and "Public" folders can be used by other software, so I would leave them as they are.

The advantage of doing this is that there's no extra setup needed, other than renaming the shortcuts from "Link to Documents" to "Documents", and so on for each of them.

But I still think it's best to just access the drive first and then to your files. It's two extra clicks and it keeps things simple.

1 Like

@Ponce-De-Leon

Would you please explain how to configure the system that the changes in

~/.config/user-dirs.dirs

are kept after reboot? I read about it but I'm not sure.

Are the only ways to do this disabling
xdg-user-dirs-update (change enabled=True to enabled=False in
/etc/xdg/user-dirs.conf)

or also editing

etc/xdg/user-dirs.defaults

and change the paths where pictures, videos and music are saved by default there, too to apply it systemwide?

@JBZorin All files from the regular picture, videos and music folders in home directory should have been removed to your second drive before editing these files because they won't be shown afterwards as the paths lead to the second drive.

To hold it simple, I would recommend the Way that @zenzen showed above. That is in my Opinion a fast and easy Way. And when You plan that from the Beginning, I would agree to him with put the home Partition on the seperate Drive. You would have to use the ''Something else'' Option during the Installation but You only have to create 3 Partitions.

1 Like

You don't need to do anything special, except ensuring that the location that each variable is pointing to already exists. For example:

Here I've updated the configuration file to point the "Downloads" and "Template" folders to "Internet" and "Whatever", respectively. After reboot, notice the second screenshot that the folder icons have automatically updated, and also the sidebar.

It doesn't show here but the behavior of Template is now also updated when creating new files. In fact, since it's empty, I can't do right-click → New File, until I put some files in there to use as base templates.

2 Likes

I tested it (only changing the path for pictures) with a new created folder in my home directory in which I put a childfolder pictures and it worked, also after reboot. :grinning_face:

1 Like