Changing the default directories for pictures, documents, etc

I'm new to Linux. Been playing with computers since the TRS-80, so I have some experience.

I have a small (250G) system drive on my laptop, but a 1Tb data drive, where everything is stored. How do I change the default directories for pictures, documents, video, etc so they point to my data drive directories?

This is something I've been doing on Windows for years.

If I right-click the Documents directory, I can look at the properties, and I see where it's pointing to, but if I click into the field, while a cursor appears, I am unable to change the content of the field.

This might be a better solution:

https://www.howtogeek.com/442101/how-to-move-your-linux-home-directory-to-another-hard-drive/

1 Like

Not quite sure if you want to outsource your whole /home directory or just wonna bind other directories under your default data directories. So your documents folder shows the files stored on the data drive.

If you want to accomplish that you have 2. options:

  1. bind via fstab
  2. use symbolic links

Both require you have your data drive mounted under a unchanging path:

sudo mkdir /mnt/data
sudo nano /etc/fstab

In fstab you had to add a new line mounting your data drive under the created directory /mnt/data.

Create new line with: (and add your UUID and change filesystem if needed)
UUID=YOUR-disk-ID /mnt/data ext4 defaults 0 0
For solution 1 add more lines in fstab
/mnt/data/PATH-on-drive-to-data /home/YOUR-USER/Documents none defaults,bind 0 0
repeat for evry home directory that needs the binding
reboot
Note: Your files stored under a binded $HOME/Documents wouldn't show cause another directory are binded under the same path - your files are save. You can move them before or unmount them under your home folders and move them afterwards.

The 2nd approach use symbolic links that replace your default home data-folders. So backup the data from e.g Documents, Music, Downloads etc.
Than you replace them - so you delete the directories you want replaced with ones of your data drive.
After they are gone create symbolic links.
ln -s /mnt/data/PATH-TO-DIRETORY $HOME/Documents

With both solutions your config files stay on /home and just the directories pinpoint to another physical disk.

Attention: Be aware that disks with filesystems under /etc/fstab are mounted during bootup, so be sure that the UUID of the added drive is correct and especially exists. Otherwise while booting and your UUID don't exist you're faced with a emergency shell. Can be a bit otherwhelming without a desktop but just edit /etc/fstab and uncomment # (at start of evry new line) all new changes and reboot or check your UUID twice :wink:

What formatting is used on your 1Tb data disk?

common directories contained in your $HOME, like Downloads/ or Pictures/ are usually manually assigned using xdg-user-dirs-update --force

Technically, you could just enter the folder you want all of those to go in and run that, which should work from all I know

Although, I don't take responsibility if it doesn't work.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.