Ubuntu – change personal folder locations

11.10directoryfilemanagerfilesystemhome-directory

I did this in Windows 7. My Documents, Videos, Music and other personal folders are in D:\ because it is my media disk.

In case of a system failure, I will always have access to these files when I reinstall the OS. I just right click, i.e. "Videos" in my personal folder (in my case named "Tesla") and click "location" to set a new location for it, which is in D:\Tesla and in the case of Videos folder in D:\Tesla\Videos. I do that for every personal folder.

Now, I want to know if this is also possible in Ubuntu 11.10? I would like, when I open my Home folder and click i.e. Videos, to go to /media/Media/Tesla/Videos (which is where my D:\ disk is mounted), instead of the default /home/tesla/Videos.

Thanks in advance.


EDIT: I already set up NTFS automounting via the NTFS Configuration Tool.

Best Answer

This can be accomplished with symlinks. But first, you need to setup your system so that the D: partition is automounted every time you boot Ubuntu.

Run sudo blkid to see the UUID (Universally Unique Identifier) for all of your partitions. Then you will have to edit your fstab with this information.

fstab is a file located in /etc/ which determines which drives and partitions should be mounted every time the system starts. Before you do anything else, make a backup of the one you have:

sudo cp /etc/fstab /etc/fstab.backup

Then, edit fstab (with for example sudo nano or gksu gedit) and add this line:

UUID=<UUID of your D: partition> /media/Media ntfs defaults 0 0

Make sure that the mount location, /media/Media, exists before doing this, then reboot.

Now it's time to create symlinks. You will need to remove the personal folders first, as otherwise the symlinks will be placed inside them instead of replacing them. Make sure to backup any files you have there before running these commands:

rm -rf ~/Videos && ln -s /media/Media/Tesla/Videos ~/Videos

Repeat for all the folders you want to appear in your Home directory.