[NTLUG:Discuss] booting from different root partitions

Jack Snodgrass jack+ntlug at mylinuxguy.net
Sat Jun 21 09:11:12 CDT 2003


I want to do something like this: 

( in case anyone asks why... this set up will let me 
go back to a previous configuration fairly easily. i.e
I just tried to install Ximian Xd2 and my installation 
failed partway through the upgrade.... Can't go forward... 
can't go back... stuck with a partially upgraded system...
boot up the previous, good /root image, replace the bad 
copy and I'm back in business.  ) 

My drive is set up like this
/dev/hda1 - /boot
/dev/hda2 - primary-root-partition
/dev/hda3 - backup-root-partition

Now... I normally boot and have /etc/fstab and /boot/grub/grub.conf
set up /dev/hda2 as / and set up /dev/hda3 as /other_root. 

I use rsync to backup / to /other_root. 

Say that I have grub have these options:

title Red Hat Linux (2.4.20-18.8)
        root (hd0,0)
        kernel /vmlinuz-2.4.20-18.8 ro root=/dev/hda2

title Red Hat Linux (2.4.20-18.8) backup
        root (hd0,0)
        kernel /vmlinuz-2.4.20-18.8 ro root=/dev/hda3

I can boot the "title Red Hat Linux (2.4.20-18.8)" grub label just
file. It's when I boot the 'backup' label that things go wrong. 

When I rsync'd the / to /other_root, both of the /etc/fstab files 
contain:
/dev/hda2               /            ext2    defaults        1 1
/dev/hda3               /other_root  ext2    defaults        1 2


which is right for the 'non-backup' grub lable, but incorrect for 
the backup version. The backup version should use:
/dev/hda2               /other_root  ext2    defaults        1 2
/dev/hda3               /            ext2    defaults        1 1

so... how can I use the 'SAME' /etc/fstab file but have 
different 'root' partitions? 

I know that I can rsync, and then modify the /other_root/etc/fstab
file afterwards, ... but I'd like to avoid that step if possible. 


Thanks - jack 









More information about the Discuss mailing list