I like to test drive various distributions and releases. I'll install a release onto a partition of my spare drive and give it a good whirl. If I decide that I really like a release, I'll fine tune it to my own needs and tastes, and when it is ready, I'll copy it to my main drive. This has worked really well for me over the past few years.
But, now comes Fedora Core 8. Since FC7 Fedora uses the device naming convention of /dev/sd(*), and arbitrary disk labeling. I can't remove the LABEL=(whetever) and use /dev/hd(*). So, after some reading, I decided it was time for me to learn more about labeling. I suppose, for an administrator, the concept would have some distinct advantages. For me, though, having just this one computer with just two hard drives, it's much easier and less likely to screw up by using the /dev/hd(*) method, rather than labels. At any rate, so that I could test FC8, and be able to port it to another drive or partition, I decided to do this exercise in using e2label.
Listed below are the current disklabels on this system as of 6:00 am, Dec. 10,2007;
$ sudo /sbin/e2label /dev/hdc1
/
[al@localhost ~]$ sudo /sbin/e2label /dev/hdc2
/hdc2
[al@localhost ~]$ sudo /sbin/e2label /dev/hdc3
/1
[al@localhost ~]$ sudo /sbin/e2label /dev/hdc5
/1234
[al@localhost ~]$ sudo /sbin/e2label /dev/hdc6
/hdc6
[al@localhost ~]$ sudo /sbin/e2label /dev/hda1
/boot1
[al@localhost ~]$ sudo /sbin/e2label /dev/hda2
/home123
[al@localhost ~]$ sudo /sbin/e2label /dev/hda3
/12
The above listed labels were arbitrarily assigned by Anaconda during the installation of various Fedora/RedHat/CentOS distributions over the life-spans of /dev/hda and /dev/hdc. My practice has always been to replace the LABEL=(whatever) with the actual device, /dev/hd(*).
With the release of Fedora Core 7, Fedora now uses disk-labeling with arbitrary control over the installation. Changeing the disk-label, or changeing /etc/fstab can, and probably will, render the installation useless unless the changes are made precisely and in BOTH e2label, AND fstab exactly the same! This will change drastically the way I have been testing distributions in the past. Simply copying the root (/) directory to another partition and then making the appropriate changes in /etc/fstab of the new location will no longer work with any Fedora Core beyond FC6.
So, I am going to try re-labeling the partitions which affect the current installation of FC8. Currently, FC8 uses /dev/hdc5 for root, no separate boot partition, no separate home partition, and /dev/hda5 as swap. I will try to re-label /dev/hdc5 as FC8-test and then edit /hdc5/etc/fstab accordingly. Then, I'll try to boot into that installation and see what happens. The time/date is Mon 10 Dec 2007 09:05:06 AM MST.
1. I made a copy of the etc/fstab for fc8, etc/fstab.test. Then I edited etc/fstab.test to reflect the new label I intended to use for that partition. Since FC8 resided entirely on that single partition, there was only one label to change.
$ sudo cat /hdc5/etc/fstab
LABEL=FC8-test / ext3 defaults 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-hda5 swap swap defaults 0 0
2. Using e2label, I changed the previous label for /dev/hdc5 from /1234 to FC8-test.
3. Then, I edited /boot/grub/grub.conf to reflect this label change in grub.conf;
title Fedora Core 8 (2.6.23.1-42.fc8)
root (hd0,0)
kernel /vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=/1234 rhgb quiet
initrd /initrd-2.6.23.1-42.fc8.img
title Fedora Core 8 (2.6.23.1-42.fc8)
root (hd0,0)
kernel /vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=FC8-test rhgb quiet
initrd /initrd-2.6.23.1-42.fc8.img
Notice that I left the original entry, and made a new entry with the new change.
4. Then, I rebooted to the new FC8 partition. It worked. Next comes the answer to this portability issue. If I copy this FC8 installation to another partition, making sure that the new partition is large enough to hold it, make the appropriate changes to the new etc/fstab and also to /boot/grub/grub.conf, will this work?
5. I prepared another partition to copy FC8 onto. Then, I copied the entire installation from /dev/hdc5 to /dev/hdc2.
6. I made the appropriate changes to the new etc/fstab and to /boot/grub/grub.conf;
$ sudo cat hdc2/etc/fstab
LABEL=FC8-test2 / ext3 defaults 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
LABEL=SWAP-hda5 swap swap defaults 0 0
sudo cat /boot/grub/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/hdc1
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
#hiddenmenu
title CentOS (2.6.18-8.1.15.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-8.1.15.el5 ro root=/dev/hda3 rhgb quiet
initrd /initrd-2.6.18-8.1.15.el5.img
(There is some other stuff here that has nothing to do with this exercise, so I deleted it.)
title Fedora Core 8 (2.6.23.1-42.fc8)
root (hd0,0)
kernel /vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=FC8-test2 rhgb quiet
initrd /initrd-2.6.23.1-42.fc8.img
7. Now, the test.... I rebooted to FC8 in its new home. It worked!
So, the portability issue does have a good workaround. However, that still leaves me with a couple of issues;
True, I am a crusty old curmudgeon, and actually quite proud of it. That said, I have a real problem with anyone telling me what I can/cannot or must/must not do on my own damn computer. So, my question regarding this whole thing of labeling, can this function be disabled so that I can use my prefered method of using /dev/hd(*) instead of labeling? If so, I think Fedora should give us information as to how to accomplish this.
If this is not possible, Fedora might well join those products from MS which I refuse to use. Don't even begin to suppose that you can impose YOUR rules on how I choose to use MY computer.
owa