Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10th December 2007, 07:30 PM
owakroeger Offline
Registered User
 
Join Date: Apr 2004
Location: Yuma, Arizona
Posts: 431
LABEL=(whatever) vs /dev/hd or sd(*)

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
__________________
owa
Reply With Quote
  #2  
Old 10th December 2007, 07:34 PM
FriedChips's Avatar
FriedChips Offline
Registered User
 
Join Date: Jul 2007
Location: Indiana USA
Posts: 1,715
welp, as you mentioned fedora switched to using /dev/sda? instead of /dev/hd?, so you can do whatever the hell you wants as long as you put it in a way fedora can understand it...
Code:
title Fedora Core 8 (2.6.23.1-42.fc8)
root (hd0,0)
kernel /vmlinuz-2.6.23.1-42.fc8 ro root=/dev/sda1 rhgb quiet
initrd /initrd-2.6.23.1-42.fc8.img
That will work just fine my friend

EDIT: of course you will need to modify that to whatever it is in your box
__________________
The answer to all of lifes questions are buried somewhere in the Google search engine.

Code:
[Stephen@localhost ~]$ whatis this?
this?: nothing appropriate

Last edited by FriedChips; 10th December 2007 at 07:43 PM.
Reply With Quote
  #3  
Old 10th December 2007, 11:40 PM
owakroeger Offline
Registered User
 
Join Date: Apr 2004
Location: Yuma, Arizona
Posts: 431
What you say is not quite true, at least for my experience. When I edited /etc/fstab to remove the LABEL=(*) designation, and replaced that with /dev/hdc5 / (and so on), the next time I tried to boot to the FC8 installation, it went crazy looking for LABEL(whatever), and LABEL(whasis), and finally just hung. It was ONLY after I restored the LABEL=(*) in fstab that I could finally reboot into FC8. Thus, this post.
Perhaps others have had a different experience. But, this was my experience. Was it just an anomily? Feed-back, please.
The naming convention of /dev/sd(*) vs /dev/hd(*) is not an issue.

owa
__________________
owa
Reply With Quote
  #4  
Old 11th December 2007, 12:36 AM
FriedChips's Avatar
FriedChips Offline
Registered User
 
Join Date: Jul 2007
Location: Indiana USA
Posts: 1,715
please post:
Code:
su -
fdisk -l
cat /etc/grub.conf
cat /etc/fstab
No that is not my experience, I usually change that scheme to callout the sda? itself rather than LABEL=whatever
__________________
The answer to all of lifes questions are buried somewhere in the Google search engine.

Code:
[Stephen@localhost ~]$ whatis this?
this?: nothing appropriate
Reply With Quote
  #5  
Old 11th December 2007, 12:57 PM
owakroeger Offline
Registered User
 
Join Date: Apr 2004
Location: Yuma, Arizona
Posts: 431
Well, it seems I have egg on my face. My apologies and my thanks.
Since I couldn't boot to FC8 with my edited fstab, I had done most of my editing and troubleshooting from my other, working, system, CentOS 5. Below is the output of fdisk -l from within CentOS 5;
$ sudo /sbin/fdisk -l

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 14103 113177925 83 Linux
/dev/hda3 14104 19202 40957717+ 83 Linux
/dev/hda4 19203 19457 2048287+ 5 Extended
/dev/hda5 19203 19457 2048256 82 Linux swap / Solaris

Disk /dev/hdc: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdc1 * 1 1213 9743391 83 Linux
/dev/hdc2 1214 2426 9743422+ 83 Linux
/dev/hdc3 2427 3639 9743422+ 83 Linux
/dev/hdc4 3640 4865 9847845 5 Extended
/dev/hdc5 3640 4852 9743391 83 Linux
/dev/hdc6 4853 4865 104391 83 Linux

~~~I deleted the stuff about the usb/flash drives

Note that the second hard drive is /dev/hdc. The cdrom is /dev/hdb. I had assumed, wrongly, that the cdrom would be /dev/sdb in FC8, making my second hard drive /dev/sdc. WRONG!!!

I then ran fdisk -l from within FC8. Below is the output of that;

# /sbin/fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000079df

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 14103 113177925 83 Linux
/dev/sda3 14104 19202 40957717+ 83 Linux
/dev/sda4 19203 19457 2048287+ 5 Extended
/dev/sda5 19203 19457 2048256 82 Linux swap / Solaris

Disk /dev/sdb: 40.0 GB, 40020664320 bytes
255 heads, 63 sectors/track, 4865 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xde94b696

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1213 9743391 83 Linux
/dev/sdb2 1214 2426 9743422+ 83 Linux
/dev/sdb3 2427 3639 9743422+ 83 Linux
/dev/sdb4 3640 4865 9847845 5 Extended
/dev/sdb5 3640 4852 9743391 83 Linux
/dev/sdb6 4853 4865 104391 83 Linux

~~~I deleted the stuff about the usb/flash drives~~~~~

As you can see, the second hard drive is actually /dev/sdb. I don't know what FC8 calls the cdrom, although it does mount. It is not mounted as /dev/sd(*), as it is in CentOS 5 /dev/hdb.
So, I'll go wipe the egg from my face, and move on. I made the appropriate corrections to fstab, and now it will successfully boot using /dev/sd(*) instead of LABEL=(whatever).

# cat /etc/fstab
#LABEL=FC8-test2 / ext3 defaults 1 1
/dev/sdb2 / 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
/dev/sda5 swap swap defaults 0 0
__________________
owa
Reply With Quote
  #6  
Old 11th December 2007, 01:08 PM
FriedChips's Avatar
FriedChips Offline
Registered User
 
Join Date: Jul 2007
Location: Indiana USA
Posts: 1,715
don't worry about it, that change has caused confusion for many as for your cdrom, the device will be /dev/cdrom but it will be mounted under /media/($CDROM_LABEL) , glad you got it sorted and you can do whatever the hell you want now LOL
__________________
The answer to all of lifes questions are buried somewhere in the Google search engine.

Code:
[Stephen@localhost ~]$ whatis this?
this?: nothing appropriate
Reply With Quote
Reply

Tags
labelwhatever, or dev or hd

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I get X11/Xaw/Label.h? ivlad Programming & Packaging 6 21st January 2007 01:26 AM
FC5 cd label ? PompeyBlue Programming & Packaging 0 20th March 2006 05:46 PM


Current GMT-time: 04:43 (Sunday, 19-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat