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.

So i edited the /etc/fstab file, and added this line

/dev/sdb1       /media/additionaldrive1 ext4 defaults   0       2

and most times, my hard drive is there waiting for me in the right location. but sometimes, and I'm not sure if i'ts at boot up, or sometimes afterwards, since I generally don't need to the use the drive immediately after boot up, I find the drive not at /media/addtionaldrive1, but at some seemingly random address of "62ae4915-ee29-414e-a684-fc700064d952"

This is annoying as it breaks file references to that drive (it has my virtual machine images). Any idea what the problem is? Reboot generally solves, it's not a very nice solution though.

edit:here is the fstab file:

proc            /proc           proc    nodev,noexec,nosuid 0       0
/dev/sda1       /               ext4    errors=remount-ro 0       1
/dev/sda5       none            swap    sw              0       0
/dev/sdb1       /media/additionaldrive1 ext4 defaults   0       2
share|improve this question
    
Is it an internal HDD? Do you see any references to the drive in the logs (/var/log/syslog for example)? –  arrange Aug 15 '11 at 21:30
    
Could you please include the whole content of your /etc/fstab. Also, what's wrong with using the standard /etc/fstab, with UUIDs (that seem more robust than paths), that Ubuntu creates on an install? –  N.N. Aug 15 '11 at 21:32
    
i see lines like this: Aug 15 17:30:49 mymachine kernel: [ 23.230331] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null) and Aug 15 17:30:49 mymachine kernel: [ 33.264252] EXT4-fs (sdb1): re-mounted. Opts: errors=remount-ro –  chrismarx Aug 15 '11 at 21:40
    
i edited the question with fstab file as well, N.N., could you elaborate on your suggestion, new to ubuntu here, what are saying I should change? –  chrismarx Aug 15 '11 at 21:41
    
ah, i think im making progress, i started reading this again (help.ubuntu.com/community/AutomaticallyMountPartitions) and i noticed that there was an additional drive being mounted... my android phone! when i usually have it plugged in to charge, etc. with the usb. anyways, starting up without it plugged in has solved the problem, i will try the uuid path approach, please suggest that as a solution so i can mark as answered –  chrismarx Aug 15 '11 at 21:52
add comment

1 Answer

up vote 4 down vote accepted

You can prevent this from happening by using UUID in place of device paths.

Your fstab should look something like

    # /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sda1 during installation
UUID=60db2d35-5065-476c-9396-92e8754dd613 /               ext4    errors=remount-ro 0       1
# /home was on /dev/sda3 during installation
UUID=66d44124-3c90-4e42-8d1a-eb8f84350b4b /home           ext4    defaults        0       2
# swap was on /dev/sda2 during installation
UUID=4bd642b2-bff1-42cf-a013-f30c592cadc9 none            swap    sw              0       0

You can find out details at https://help.ubuntu.com/community/Fstab

and a guide on how to set this up at http://www.cyberciti.biz/faq/linux-finding-using-uuids-to-update-fstab/

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.