Here is something better: have both the “working” and “testing” installs active at one time. No need for hidden partitions. You can have Windows there too. You will use menu lines in Grub to select which you want at any given time. Basically, you establish two or more root partitions on your disk. With this, you can
- Compare files, etc between the two versions
- Run some commands in the alternate roots.
First, when installing OpenSUSE (or any Linux) create separate partitions. For example, I would recommend something like:
- /boot: about 1GB
- / (a.k.a., root): 10 GB should be enough to hold must about everything
- /usr/local (for local scripts/programs that are installed with means other than RPMS): Size according to your needs. For simple installs, 1 GB is enough. I load Matlab, a PowerPC complier for embedded software and need about 8 GB.
- swap: as required: 4 GB should be enough
- /home
- /var/spool: holds mail, cron jobs, etc between “working” and “test” installs.
- /testing; Normally, I don’t recommend this, but in your case, this could be your alternate root (for example, a “testing”). Make as many as you require. For example, your base root could be OpenSUSE 11.1, /testing a testing version, /ubuntu Ubuntu and so on. With the install of the first OS, you won’t do anything with these except to allocate space and partition.
When you do the first install, you must note where the partitions are. I use partition “labels” and mount partitions via labels rather than device names (e.g., /dev/sda2). This makes it easy to move around. Don’t worry if you forget to set the labels, for the command “tune2fs” can be used to add labels. When mounting, use the label. For example, my laptop’s /etc/fstab file in the primary root looks like:
LABEL=boot /boot ext3 noatime,acl,user_xattr 1 2
LABEL=root-suse-11.0 / ext3 noatime,acl,user_xattr 1 1
LABEL=tmp /tmp ext3 noatime,acl,user_xattr 1 2
LABEL=swap swap swap defaults 0 0
LABEL=aux /aux ext3 noatime,acl,user_xattr 1 2
/dev/mapper/cr_sda11 /home ext3 noatime,acl,user_xattr,noauto 0 0
LABEL=usr-local /usr/local ext3 noatime,acl,user_xattr 1 2
LABEL=usr-src /usr/src ext3 noatime,acl,user_xattr 1 2
LABEL=vmware /vmware ext3 noatime,acl,user_xattr 1 2
LABEL=root-suse-10.3 /10.3 ext3 noatime,acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0
Now, for two scenarios:
Setting up a testing install from a working "baseline:" Use dump/restore rather than tar or cpio. The reason is dump/restore works with the raw disk where tar and cpio will copy the mounted files, etc. First, make sure the /testing partition is “prestine” (that is, it was recently formatted). Then do the copy of the baseline baseline to the testing partition. Use commands like
cd /testing
dump -0f - / | restore -raof -
The last steps are to
- Modifiy /boot/grub/menu.lst to add entries for the testing install. Example below. Change the root as appropriate
- Change /testing/etc/fstab so that / is the /testing partition and /baseline is the original /. For example the baseline /etc/fstab
Installing an alternate distribution: When doing the install, don’t do anything with the baseline /, but create the new distribution’s / in one of the alternate partitions. Before installing: save the /boot/grub/menu.lst somewhere incase the new install destroys the file. Duing the install, don’t format /boot … it will be shared between the distributions/alternate installs. After installation: fix up /boot/grub/menu.lst as needed.
A “sample” /boot/grub/menu.lst:
default 0
timeout 8
##YaST - generic_mbr
gfxmenu (hd0,1)/message
##YaST - activate
###Don't change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.0 - 2.6.27.19-3.2
root (hd0,1)
kernel /vmlinuz-2.6.27.19-3.2-pae root=/dev/disk/by-label/root-suse-11.0 resume=/dev/sda7 splash=silent vga=0x317
initrd /initrd-2.6.27.19-3.2-pae
###Don't change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe -- openSUSE 11.0 - 2.6.27.19-3.2
root (hd0,1)
kernel /vmlinuz-2.6.27.19-3.2-pae root=/dev/disk/by-label/root-suse-11.0 showopts ide=nodma apm=off acpi=off noresume nosmp noapic maxcpus=0 edd=off x11failsafe vga=0x317
initrd /initrd-2.6.27.19-3.2-pae
title openSUSE 10.3 - 2.6.25.999
root (hd0,10)
kernel /vmlinuz-2.6.25.999-pae root=/dev/disk/by-label/root-suse-10.3 resume=/dev/sda7 splash=silent vga=0x317
initrd /initrd-2.6.25.999-pae
###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
rootnoverify (hd0,1)
chainloader (hd0,0)+1
It is also very helpful to learn how to use various mount commands and chroot. For example, let’s say I’m booted into the testing version and I wanted to see what RPMs were installed in the baseline version:
mount -o bind /home /baseline/home
mount -o bind /dev /baseline/dev
mount -t proc none /baseline/proc
chroot /baseline
rpm -qa > /home/baseline-rpms
exit