changing boot disk

Go to solution
Thomas Schler_1
Trusted Contributor

changing boot disk


We are running RedHat Linux 4 Enterprise Server. 3 disks are inside of the PC.
We are running a hardware RAID 1 (mirrored disks) on two disks and a simple RAID
0 on the third disk. So, we're not using the software RAID of RedHat Linux.

For security reasons we copied the complete content of the RAID 1 disks
(/dev/sda) to the RAID 0 (/dev/sdb) disk, so we've the similar filesystem layout
on both disks. And we're able to boot from the RAID 0 disk.

The problem:

After rebooting, the original device file /dev/sda are used for mounting the
filesystems, although we booted from the RAID 0 disk. But we need the filesystem
mounted via /dev/sdb. We wanted to change the device file entries in /etc/fstab,
but the content of fstab is:

# This file is edited by fstab-sync - see 'man fstab-sync' for details
LABEL=/1 / ext3 defaults 1 1
LABEL=/boot1 /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/usr /usr ext3 defaults 1 2
LABEL=/var /var ext3 defaults 1 2
LABEL=SWAP-sda6 swap swap defaults 0 0
/dev/hdb /media/cdrom auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0
/dev/hda /media/floppy auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0

The device /dev/sda ist not listed here. So, how do we manage to get the
filesystem mounted via /dev/sdb after booting from the RAID 0 disk?

no users -- no problems
Vitaly Karasik_1
Honored Contributor

Re: changing boot disk


You have two ways to fix this problem:

1) to change filesystems labels on /dev/sdaX to something else, for example

e2label /dev/sda1 newlabel

2) change to fstab:
instead of
>LABEL=/usr /usr ext3 defaults 1 2
you should put
/dev/sdb2 /usr ext3 defaults 1 2

Note! - in order to understand which partition labeled as "/usr", you should use
e2label /dev/sda1 [2,3,4,5,6,...] commands.

(In general, filesystem labels is effort to build the new abstract layer above disk partitions. In means, we work with filesystem labeled as "/usr" instead of using partition from /dev/sdd7. Sometimes it confusing...)

Ivan Ferreira
Honored Contributor

Re: changing boot disk

LABELs are used instead of device names because device names can change with the time and the modification of the disk structure. Basically, every partition has a label, and instead of using /dev/sda1 you use LABEL=/boot1 for example. You can check the label for a partition with e2label. As described above, you can replace the LABEL= with /dev/sdbX.

I want to know what is your strategy? Booting for that disk could not be as easy as you think, the boot loader also has information about the partitions that should use to boot. You should modify your boot loader first. Also, the boot loader may not be installed on your RAID 0 disk.

How will you keep these filesystems sync?
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?