Bug 25038

Summary: Kickstart assigns LABEL= in fstab for vfat partition
Product: [Retired] Red Hat Linux Reporter: Anders Blomdell <anders.blomdell>
Component: anacondaAssignee: Erik Troan <ewt>
Status: CLOSED RAWHIDE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard: Florence RC-1
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-01-31 06:46:38 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Anders Blomdell 2001-01-26 12:29:28 EST
When kickstart was confronted with a kickstart file with these lines:

  part /dos/c --size 2000 --type 6
  part / --size 2000 

it come up with the following fstab:

  LABEL=/        /        ext2    defaults        1 1
  LABEL=/dos/c   /dos/c   vfat    defaults        0 0

this is not very good after the /dos/c is properly formatted, because then 
the ext2 LABEL seems to disappear, and subsequent mounts will fail...

A workable fix seems to be (i.e. only ext2 partitions can be mounted by 
LABEL):

--- O.fstab.py  Fri Jan 26 16:29:03 2001
+++ fstab.py    Fri Jan 26 16:33:36 2001
@@ -734,7 +734,7 @@
                dev = "loop1"
                fs = "ext2"
 
-           if labels.has_key(dev):
+           if labels.has_key(dev) and fs == "ext2":
                devName = "LABEL=" + labels[dev]
            else:
                devName = '/dev/' + dev
Comment 1 Michael Fulbright 2001-01-26 12:41:10 EST
Thank you for your report.

Assigning to a developer.
Comment 2 Erik Troan 2001-01-30 16:30:20 EST
I've gone ahead and put your patch into anaconda, as it certainly won't hurt
anything.

I'd love to
Comment 3 Erik Troan 2001-01-30 16:36:51 EST
Wow, that was a useful commentary.

Anyway, I'm trying to fix this the right way. It looks like we're mke2fs'ing
partitions we're creating as DOS partitions during kickstart, and that's just
not right.
Comment 4 Erik Troan 2001-01-30 17:06:25 EST
I have no idea how you got here, but I'm going to commit this fix instead.

Index: fstab.py
===================================================================
RCS file: /mnt/devel/CVS/anaconda/fstab.py,v
retrieving revision 1.126
diff -u -r1.126 fstab.py
--- fstab.py	2001/01/25 00:20:21	1.126
+++ fstab.py	2001/01/30 21:00:57
@@ -632,6 +632,11 @@

	continue

 	    for i in range (len (table)):
+
	(type, start, size) = table[i]
+
+
	# right now we only support label's on ext2 partitions
+
	if type != _balkan.EXT2: continue
+

	dev = drive + str (i + 1)

	try:

	    skipList.index(dev)

Should do the same thing.
Comment 5 Anders Blomdell 2001-01-31 06:46:35 EST
Seems like that fix has the same effect as mine, baut I can't test it at the 

moment since the fstab.py seems to have been changed in between. But there is 

still problems with LABEL= mounts; I had a disk that was partitioned like this:

  

  partition#1: ext2		label="/"

  Partition#2: FAT



this was changed to:



  partition#1: FAT		(now bogus)label="/"

  partition#2: ext2		label="/"



This lead to an fstab containing:



  LABEL=/		/		ext2 	...

  /dev/hda1		/dos/c	vfat	...



But mount believed in the [bogus] label in the vfat partition, leading to /dev/

hda1 being mounted as "/". In my opinion:



  a. mount needs to be fixed to check that labels are read from valid

	 filesystems...



  b. it would be nice to have a "--nolabelmount" in kickstart, to be

	 able to avoid the LABEL= stuff altogether.



BTW. I've added a comment to bug #23602, that is related to the issues in this 

bug report.





Comment 6 Brock Organ 2001-02-19 12:50:04 EST
verified fix in qa0217.1 ...

... anders' concern is observed behavior, but note this behavior does not occur
if the partition is zeroed or validly formatted by mkdosfs ...