Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

My machine has Windows 7 Ultimate x64 and Ubuntu 12.04 LTS running side-by-side on a single hard drive with GRUB bootloader, each with 500 GB storage. I keep my personal documents on a separate 1TB hard drive so they remain isolated from any changes I make to the OS drive, but when Ubuntu starts it does not seem to notice my documents drive. While I've installed and worked with Ubuntu 12.04 Server x32 before, using it as a desktop OS is new to me. I use my documents drive for all of my personal data, including wallpapers and music, so it is imperative that Ubuntu recognize it on startup.

Concerning the two specific examples: Ubuntu loads with the default blue-colored desktop instead of my desired picture of the spectacular Carina galaxy. When I right-click the desktop and select "Change Desktop Background", it wakes up from its amnesia and loads the proper background. As for my music, Rhythmbox defaults to an empty library upon reboot, forcing me to reload the settings manually each time. This gets quite tedious because I certainly can't work to my full potential without my music.

The second thing I would like to address is making Ubuntu point the documents directories in ~ to their appropriate counterparts on the 1TB documents drive. I realize that this question is not new, but when I create the symbolical links, they established themselves inside the directories and did not convert the directories themselves into symbolical links. I also prefer not to move the files themselves from their current location on the 1TB drive. I believe this would also help the Rhythmbox library problem as well considering it's a default directory for the music player.

Excerpt from fstab:

proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sdb6 during installation
UUID=057ac83e-76ad-460d-86e5-b6d46e9b1d80 / ext4 errors=remount-ro 0 1 # swap was on /dev/sdb7 during installation 
#UUID=1183df90-23fc-44e4-aa17-4e7c9865d5cb none swap sw 0 0 /dev/mapper/cryptswap1 none swap sw 0 0

That's enough content for one question. I really like the Ubuntu experience so far since it doesn't treat me like an idiot out of the box (can't say the same for Windows) so I can't wait to hear from the community! Thanks for your help in advance.

share|improve this question
    
Removing the top comment for length concerns: proc /proc proc nodev,noexec,nosuid 0 0 # / was on /dev/sdb6 during installation UUID=057ac83e-76ad-460d-86e5-b6d46e9b1d80 / ext4 errors=remount-ro 0 1 # swap was on /dev/sdb7 during installation #UUID=1183df90-23fc-44e4-aa17-4e7c9865d5cb none swap sw 0 0 /dev/mapper/cryptswap1 none swap sw 0 0 –  PlanoAlto Jul 9 '12 at 8:53
add comment

2 Answers

up vote 1 down vote accepted

Correct me if I'm wrong, but it sounds like you do not auto-mount the drive (and/or make the links) at startup.

To do this, you need to add a line to your /etc/fstab file. I'm not sure if you've ever done such a thing before, so I'm going to walk you through step by step. If anything is unclear, please let me know.

In the dash, search for terminal. Run it. In the terminal window that appears, type

gksudo gedit /etc/fstab

Enter your password in the window that pops up. In the gedit window that pops up, add a line (or lines) that refers to your documents drive, and/or binds everything to your own liking.

As an example, here is my setup:

# data drives
LABEL=data1                    /mnt/data1                      ntfs    defaults                               0       0
LABEL=data2                    /mnt/data2                      ntfs    defaults                               0       0

# binds
/mnt/data1/Apps/               /home/rody/Apps                 none    rw,bind                                0       0
/mnt/data1/Audiobooks/         /home/rody/Audiobooks           none    rw,bind                                0       0
/mnt/data1/Desktop/            /home/rody/Desktop              none    rw,bind                                0       0
/mnt/data2/Dev/                /home/rody/Dev                  none    rw,bind                                0       0
/mnt/data1/Dropbox/            /home/rody/Documents            none    rw,bind                                0       0
/mnt/data2/Downloads/          /home/rody/Downloads            none    rw,bind                                0       0
/mnt/data1/eBooks/             /home/rody/eBooks               none    rw,bind                                0       0
/mnt/data1/Games/              /home/rody/Games                none    rw,bind                                0       0
/mnt/data1/Videos/             /home/rody/Videos               none    rw,bind                                0       0
/mnt/data2/Music/              /home/rody/Music                none    rw,bind                                0       0

The top three lines make Ubuntu aware of the drive, in my case, 2 drives. It attaches them to directories inside /mnt/ (which is the conventional location). It is quite possible that you need to make new directories here (don't forget sudo).

All the other lines are just to link directories on the data drives to directories in my home directory. When creating bind mounts, also those directories need to exist in your home directory as well.

Note that I use drive labels to refer to my drives -- I think this is the best and most stable way to do it. You can find out (or set) your document drive's label in, for example, the Ubuntu disk utility (search for it in the dash).

share|improve this answer
    
I tried this out (but I chose my preferred vim over gedit), and I'd like to post some code but don't know how to make it come out properly like in your post. Aside from a typo of my own doing the drive mounted without any errors at the Plymouth screen, but I still have the wallpaper and Rhythmbox library issues. My home directories still don't point properly to the resources on my Documents drive, which I figured would also happen given the failures of the other two features. I gave the drive a label in Windows already, which I replicated in my fstab file. –  PlanoAlto Jul 9 '12 at 9:46
    
I predicted your answer already: change the directories to their equivalents located in the /mnt/ directory. The wallpaper and library both loaded without problems on a restart (as a bonus I got GlobalMenu disabled!) I'm going to mark this as the accepted answer since it was clearly written and easy to follow. Thanks for the fix and thanks to all the others who contributed their knowledge! –  PlanoAlto Jul 9 '12 at 10:00
    
Just a note: I do something similar to this BUT, I have an installation script (because I occasionally switch distro's) that deletes the "My Documents", "My Videos", etc. folders in a newly created home folder and replaces them with LINKs to to data drive. –  Julian Knight Jul 9 '12 at 10:23
    
Glad to help. BTW -- you can post nice code blocks just by prepending text with 4 spaces. –  Rody Oldenhuis Jul 9 '12 at 10:23
    
Links, bind mounts, whatever works best for you :) I just prefer binds so that the link targets don't show up in a terminal all the time. –  Rody Oldenhuis Jul 9 '12 at 10:25
show 2 more comments

First of all, you will need to make sure that your storage drive is mounted at startup. You will need to edit your /etc/fstab accordingly, with adding a new line:

/dev/sdb1    /mount/storage    ntfs-3g    uid=1000,gid=100,umask=0022    0 0

(The uid and gid will be the file-access user and group ID the driver will use. /dev/sdb1 is the partition (second SATA hard drive, first primary partition) and /mount/storage will be the folder it is mounted to.)

Make sure that the device mounts properly every time.

After this is done you will need to set up the symbolical links. You can't convert directories to symbolical links, all you can do is to move the current contents of ~/Music to /media/storage/Music on the storage drive. Then, rmdir ~/Music to remove the folder and then ln -s /media/storage/Music ~/Music to set up the symbolical link.

Advice: you should do the editing not from inside the graphical interface, but from the typewriter interface (Ctrl + Alt + F1) so the GUI's integrations will not interfere with your plans.

Reboot, and you should be all set.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.