I've installed Windows 7 and Ubuntu on my notebook. I want to share the user folders:
In my instalation I've 3 partitions:
I already have setted the Windows 7 folders on partition Data
. But is so hard change the Ubuntu folders.
I tried change paths with:
gedit .config/user-dirs.dirs
I.E.:
XDG_PICTURES_DIR="/media/user/Dada/Pictures"
But everytime when I restart, the value changes to "$HOME/"
How can I change path of user folders of Ubuntu and add to menu Locals
on file explorer?
I do this all the time with my computers. I have my documents, pictures, and music (etc) on the NTFS partition and then link them over to my Ubuntu installation. Works flawlessly. I even link my Thunderbird installation, so that my emails are synced as well.
The key is to MOUNT the drive on boot. Here is how you do what you asked for:
First, you will need to make sure you have the proper NTFS packages installed to mount them with read/write (all the commands to follow are done in a terminal window):
sudo apt-get install ntfs-3g
To figure out which one is your actual partition (with your user data on it), you will need to find out which one is the right one by it's size. Type this:
sudo fdisk -l | grep NTFS
This will show something like this:
/dev/sda1 * 2048 718847 716800 350M 7 HPFS/NTFS/exFAT
/dev/sda2 718848 467937279 467218432 222.8G 7 HPFS/NTFS/exFAT
/dev/sda3 467937280 468858879 921600 450M 27 Hidden NTFS WinRE
/dev/sda2
shows up as 222.8G for me and is the right size of the partition I am looking for. You will have to match the right one for you.
To make sure that plugging in an external drive or USB stick doesn't mess up the sdX naming convention of the drives when you boot up, we will NOT use that to mount the drive. We will instead get the UUID of it. This way we make sure to always mount the right drive! To get the UUID type:
sudo blkid | grep sda2
This should show something like this:
/dev/sda2: UUID="2292B90B92B8E507" TYPE="ntfs" PARTUUID="446ec305-02"
Now we have all the information to put something into fstab to automatically mount the drive in a directory of our choice.
First make a backup of your fstab file. Just in case something goes wrong.
sudo cp /etc/fstab /etc/fstab.bak
Now let's edit.
Using GEDIT: (easier for beginners)
gksudo gedit /etc/fstab
OR using terminal (nano): (good to learn)
sudo nano /etc/fstab
Add this line at the end of the file:
#Added By Carlos
UUID=2292B90B92B8E507 /windows_data ntfs-3g defaults,windows_names,locale=en_US.utf8 0 0
Change the UUID to match yours. Also, I am assuming you live in the US, and if not, you will need to change the locale.
Finally, let's make the directory:
sudo mkdir /windows_data
You can call it 'windows_data' or whatever you want. Just make sure to match it to the entry in fstab.
Let's mount it! Well, first unmount it to make sure. Use the sdX of your partition to do that. Mine would be:
sudo umount /dev/sda2
Then mount it all properly:
sudo mount -a
If everything worked, you will now have your windows partition automatically mounted to /windows_data! Pat yourself on the back for a job well done so far! :)
Ok, let's do the final step: link the directories you wanted! And this is the easiest step.
What I usually do is to open TWO nautilus windows (the Ubuntu file explorer). Hit the Windows key on your keyboard and type "nautilus". Open one and go to your "Home" directory (should be in "/home/" somewhere).
Open another and go to "/windows_data". Then go into your users data directory in there. Right-click on the directory (like "Documents") and select "Make Link" and it will create a shortcut there. Move the shortcut by pressing CTRL-X and then CTRL-V in the other nautilus window.
Delete the old 'Documents' directory in your Ubuntu home directory (if it is empty) and rename the shortcut to 'Documents'.
Rinse and repeat for the rest of the directories.
I hope I didn't move too fast. If you need more info on anything I can edit this answer to add more detail.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments