LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Grub boot Hard disk- make 'root=' option a variable (/dev/sda1 keeps changing), (https://www.linuxquestions.org/questions/linux-general-1/grub-boot-hard-disk-make-root%3D-option-a-variable-dev-sda1-keeps-changing-525350/)

carl0ski 02-03-2007 06:56 PM

Grub boot Hard disk- make 'root=' option a variable (/dev/sda1 keeps changing),
 
The problem is that /dev/sda keeps changing to /dev/sdc
Depending on what other USB , sata happen to be connected at boot

Any way of making root=variable

Code:

title                kernel 2.6.17-10-generic
root                (hd0,4)
kernel                /boot/vmlinuz-2.6.17-10-generic root=/dev/sda5 ro quiet splash
initrd                /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot


syg00 02-03-2007 07:07 PM

You're looking at this arse-about.
If the disk changes, fstab will also be wrong.

The solution is not to change grub (and everything else), but to make the disk address static. Sounds like udev is causing you grief - set some (udev) rules to force the disks to where you want them.

carl0ski 02-03-2007 07:41 PM

Quote:

Originally Posted by syg00
You're looking at this arse-about.
If the disk changes, fstab will also be wrong.

The solution is not to change grub (and everything else), but to make the disk address static. Sounds like udev is causing you grief - set some (udev) rules to force the disks to where you want them.

I fixed FSTAB thank you very much

FSTAB uses the unique Hard Disk UUID to mount partitions

however Grub locks up when /dev/sda5 changes to /dev/sdc5 or /dev/sdb5

but i will look around for udev configuration rules

syg00 02-03-2007 07:53 PM

Quote:

Originally Posted by carl0ski
FSTAB uses the unique Hard Disk UUID to mount partitions

Good point - never use it personally.
The udev rules will come in handy other ways too - say when mounting a camera.

joelscott 02-03-2007 08:55 PM

Another option is to use the 'label' option in grub.conf.

i.e. root=label=bigdrive

where 'bigdrive' is the label on your portable drive. That way you don't need to deal with udev.

Hope this helps.


All times are GMT -5. The time now is 05:57 PM.