fstab sometimes switches drives to an incorrect configuration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu |
New
|
Undecided
|
Unassigned |
Bug Description
When I reboot, my /etc/fstab is changed to a non-working configuration.
I am using Hardy 64 and I have three hard drives. The first is a 160GB SATA for Windows, the second is a 320GB SATA for Ubuntu, and the third is a 40GB IDE for my music.
Here is how I mounted the Windows and Music drives in my fstab:
/dev/sda1 /media/sdb1 ntfs-3g defaults,
/dev/sdc1 /home/jeremy/Music ntfs-3g defaults,
When I reboot, those two lines change to this (which is wrong):
/dev/sdb1 /media/sdb1 ntfs-3g defaults,
/dev/sda1 /home/jeremy/Music ntfs-3g defaults,
Here is the output of sudo fdisk -l:
Device Boot Start End Blocks Id System
/dev/sda1 * 1 19456 156280288+ 7 HPFS/NTFS
Disk /dev/sdb: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000001
Device Boot Start End Blocks Id System
/dev/sdb1 * 1 38161 306528201 83 Linux
/dev/sdb2 38162 38913 6040440 5 Extended
/dev/sdb5 38162 38913 6040408+ 82 Linux swap / Solaris
Disk /dev/sdc: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0009fbd4
Device Boot Start End Blocks Id System
/dev/sdc1 * 1 4865 39078081 7 HPFS/NTFS
Hi Jeremy:
I was running into what I think is the same problem see https:/ /bugs.launchpad .net/ubuntu/ +bug/223994 but no one is commenting on it so, maybe there is something I am missing.
So I think the easiest solution is just to give the various partitions labels and then use the labels in the grub menu.lst and the fstab files. See here: http:// osdir.com/ ml/boot- loaders. grub.bugs/ 2004-10/ msg00039. html for the shortest example. tune2fs does partition labeling http:// tldp.org/ HOWTO/html_ single/ Partition/ if you didn't know that already. So you could name all the partitions after where they should be eg /dev/sdb1 gets the label "/dev/sdb1" and then the fstab and grub menu.lst get a LABEL=/dev/sdb1 and all's well. Then if you ever reformat the disk you have to remember to reassign the partition label but better than trying to figure out where that hard drive wandered off to.