Skip to contentSkip to conversation

cant mount LV via partition/filesystem labels

linux-lvm Ben Snyder 4 participants 6 messages Nov 7, 2002 – Nov 12, 2002

lore
Share & tools
lore

Ben Snyder

author
#0 lore raw

Here's what I've got:

RH7.2, kernel 2.4.9-34enterprise

1 physical volume each on /dev/sda9 and /dev/sdb1
one logical volume over these two PV's

I've labeled the filesystem via 'tune2fs' and want to use the label for mounting purposes, as is the default with the other (non-LVM) filesystems

'vgscan' and 'vgchange -a y' have been performed
'vgdisplay' and 'lvdisplay' tell me all is well - everthing is read/write and available 'fsck' on the physical path reports clean...

If I attempt to mount via the physical path to the LV, providing the mount point, everything works fine

However, mount refuses to mount via filesystem/partition label, regardless if I use '-L' and provide the label or use the mountpoint and let mount figure it out on its own from /etc/fstab. I get 'mount: no such partition found' (it is in /etc/fstab correctly, already checked that).

Am I missing something about labels? Maybe some other remedial filesystem characteristics/operations that I've missed because of cranius-up-rectus (head up a$$).

Thanks in advance for feedback/suggestions.

#1 lore raw
Quoted 23 lines · Ben Snyder

Here's what I've got:

RH7.2, kernel 2.4.9-34enterprise

1 physical volume each on /dev/sda9 and /dev/sdb1
one logical volume over these two PV's

I've labeled the filesystem via 'tune2fs' and want to use the label for mounting purposes, as is the default with the other (non-LVM) filesystems

'vgscan' and 'vgchange -a y' have been performed 'vgdisplay' and 'lvdisplay' tell me all is well - everthing is read/write and available
'fsck' on the physical path reports clean...

If I attempt to mount via the physical path to the LV, providing the mount point, everything works fine

However, mount refuses to mount via filesystem/partition label, regardless if I use '-L' and provide the label or use the mountpoint and let mount figure it out on its own from /etc/fstab. I get 'mount: no such partition found' (it is in /etc/fstab correctly, already checked that).

Quoted 5 lines

Am I missing something about labels? Maybe some other remedial filesystem characteristics/operations that I've missed because of cranius-up-rectus (head up a$$).

Thanks in advance for feedback/suggestions.

Ben,
say your logical volume path is /dev/vg00/lv01 and that LV holds your ext2 filesystem.

tune2fs -L Whatever /dev/vg00/lv01 # labels it with volume name "Whatever"

If you have an entry in /etc/fstab like:
/dev/vg00/lv01 /mnt ext2 defaults 1 1

running "mount -L Whatever" should do the trick. Presumably /mnt exists and the volume group is active.

Quoted 7 lines

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Signature · 15 lines
Regards,
Heinz    -- The LVM Guy --

*** Software bugs are stupid.
    Nevertheless it needs not so stupid people to solve them ***

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

Heinz Mauelshagen                                 Sistina Software Inc.
Senior Consultant/Developer                       Am Sonnenhang 11
                                                  56242 Marienrachdorf
                                                  Germany
[email protected]                           +49 2626 141200
                                                       FAX 924446
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
#2 lore raw
In reply to Ben Snyder
Quoted 18 lines · Ben Snyder

Here's what I've got:

RH7.2, kernel 2.4.9-34enterprise

1 physical volume each on /dev/sda9 and /dev/sdb1
one logical volume over these two PV's

I've labeled the filesystem via 'tune2fs' and want to use the label for mounting purposes, as is the default with the other (non-LVM) filesystems

'vgscan' and 'vgchange -a y' have been performed 'vgdisplay' and 'lvdisplay' tell me all is well - everthing is read/write and available
'fsck' on the physical path reports clean...

If I attempt to mount via the physical path to the LV, providing the mount point, everything works fine

Quoted 9 lines

However, mount refuses to mount via filesystem/partition label, regardless if I use '-L' and provide the label or use the mountpoint and let mount figure it out on its own from /etc/fstab. I get 'mount: no such partition found' (it is in /etc/fstab correctly, already checked that).

Am I missing something about labels? Maybe some other remedial filesystem characteristics/operations that I've missed because of cranius-up-rectus (head up a$$).

I'm the guy sent in the patch to add LVM label support to mount and e2fsprogs. I'm not sure RedHat 7.2 includes the proper version of those tools at all. I've had problems were built by RedHat.

The label stuff in mount and e2fsprogs reads /etc/partitions and searches all entries in that file for labels. It doesn't search anything else. LVM didn't (probably still doesn't) show up in etc partitions so label support fails. It should search in the /proc files that have the LVM stuff to find them, and search for those. That's what I added to the code, but I haven't seen it work since I sent in the patch.

It's not hard to modify the code, I didn't bother figuring out why the redhat tools fails. It wasn't terribly important to me. If you want to look at it I will. If nothing else I can send you a patch that you can use to rebuild your source RPM with.

Thanks,
Kirby

Quoted 9 lines

Thanks in advance for feedback/suggestions.

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Signature · 1 line
Real Programmers view electronic multimedia files with a hex editor.
#3 lore raw

I wouldn't mind seeing the patches.

Thanks
-steve

Quoted 61 lines · Kirby C. Bohling
Quoted 13 lines · Ben Snyder

Here's what I've got:

RH7.2, kernel 2.4.9-34enterprise

1 physical volume each on /dev/sda9 and /dev/sdb1
one logical volume over these two PV's

I've labeled the filesystem via 'tune2fs' and want to use the label for mounting purposes, as is the default with the other (non-LVM) filesystems

'vgscan' and 'vgchange -a y' have been performed
'vgdisplay' and 'lvdisplay' tell me all is well - everthing is read/write and available 'fsck' on the physical path reports clean...

Quoted 8 lines

If I attempt to mount via the physical path to the LV, providing the mount point, everything works fine

However, mount refuses to mount via filesystem/partition label, regardless if I use '-L' and provide the label or use the mountpoint and let mount figure it out on its own from /etc/fstab. I get 'mount: no such partition found' (it is in /etc/fstab correctly, already checked that).

Am I missing something about labels? Maybe some other remedial filesystem characteristics/operations that I've missed because of cranius-up-rectus (head up a$$).

I'm the guy sent in the patch to add LVM label support to mount and e2fsprogs. I'm not sure RedHat 7.2 includes the proper version of those tools at all. I've had problems were built by RedHat.

The label stuff in mount and e2fsprogs reads /etc/partitions and searches all entries in that file for labels. It doesn't search anything else. LVM didn't (probably still doesn't) show up in etc partitions so label support fails. It should search in the /proc files that have the LVM stuff to find them, and search for those. That's what I added to the code, but I haven't seen it work since I sent in the patch.

It's not hard to modify the code, I didn't bother figuring out why the redhat tools fails. It wasn't terribly important to me. If you want to look at it I will. If nothing else I can send you a patch that you can use to rebuild your source RPM with.

Thanks,
Kirby

Quoted 11 lines

Thanks in advance for feedback/suggestions.

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

#4 lore raw
Quoted 5 lines · Steven Dake

I wouldn't mind seeing the patches.

Thanks
-steve

Steve,

I'm an idiot... I sent Ted Tso the a patch, that was crappy, but
worked. He re-wrote it, and accidently inverted the a check in the logic. I replied to him that the patch worked, but he'd inverted this check, if he fixed that it was great. I didn't however send him the a correct patch back. That was stupid on my part. I shouldn't have replied with it works, w/o a corrected patch.

The patch that fixes the LVM so fsck to it works is this attached as
fsck_lvm_labels.patch.

It's a trivial one line fix. This applies to 1.26. I'm guessing it
will apply to any version of the e2fsck since then. That was the earliest version that it did work on. It applies cleanly on 1.32 which is the latest version on sourceforge.

My copy of mount does work with LVM devices. mount-2.11g-5 from redhat
is what I'm using. According to this page:

http://compton.phys.iit.edu/doc/util-linux-locales/changelog

The fix went in on util-linux 2.11n. Not sure what is the deal with
that. I'm pretty sure I didn't install a modified version of mount on my machine. I've reinstalled, and remember being upset it didn't work on the fresh install. So maybe I did.

Unfortuantely, the crappy code I sent to the mount maintainer did make
it in (Ted fixed mine up nicely, with the exception of the logic inversion). Mine's got a few resource leaks that I should fix up. I'll try and work up a cleaner patch and sent it to the mount maintainer. The newer versions of mount however, work just fine, and it is in the mainline version of mount now.

Either way, the pertinate code is in:

e2fs-progs-1.26/misc/get_device_by_label.c

Look for the function named init_lvm.

In the util-linux package it's at:

util-linux-2.11r/mount/mount_by_label.c

Look for it the function: uuidcache_init_lvm.

The code won't work if you use devfs. It assumes that the proper name
is:
/dev/"VG_NAME"/"LV_NAME"

In reality, it should open /proc/lvm/VGs/data/LVs and read the file
looking for "name:", and grab data the colon, and use it for the device. That was more work then I deemed worth it at the time to get my stuff going. I wasn't sure how much internally LVM was holding to the proc file interface. So I wasn't going to depend on that without more information.

It's a hack, but it works enough to get me going which is all I really
wanted. If that isn't what you wanted, or you want more information just ask. It's not wonderful, but it works for me.

Thanks,
Kirby

Quoted 79 lines
Quoted 45 lines · Kirby C. Bohling
Quoted 18 lines · Ben Snyder

Here's what I've got:

RH7.2, kernel 2.4.9-34enterprise

1 physical volume each on /dev/sda9 and /dev/sdb1
one logical volume over these two PV's

I've labeled the filesystem via 'tune2fs' and want to use the label for mounting purposes, as is the default with the other (non-LVM) filesystems

'vgscan' and 'vgchange -a y' have been performed 'vgdisplay' and 'lvdisplay' tell me all is well - everthing is read/write and available
'fsck' on the physical path reports clean...

If I attempt to mount via the physical path to the LV, providing the mount point, everything works fine

Quoted 11 lines

However, mount refuses to mount via filesystem/partition label, regardless if I use '-L' and provide the label or use the mountpoint and let mount figure it out on its own from /etc/fstab. I get 'mount: no such partition found' (it is in /etc/fstab correctly, already checked that).

Am I missing something about labels? Maybe some other remedial filesystem characteristics/operations that I've missed because of cranius-up-rectus (head up a$$).

I'm the guy sent in the patch to add LVM label support to mount and e2fsprogs. I'm not sure RedHat 7.2 includes the proper version of those tools at all. I've had problems were built by RedHat.

The label stuff in mount and e2fsprogs reads /etc/partitions and searches all entries in that file for labels. It doesn't search anything else. LVM didn't (probably still doesn't) show up in etc partitions so label support fails. It should search in the /proc files that have the LVM stuff to find them, and search for those. That's what I added to the code, but I haven't seen it work since I sent in the patch.

Quoted 24 lines

It's not hard to modify the code, I didn't bother figuring out why the redhat tools fails. It wasn't terribly important to me. If you want to look at it I will. If nothing else I can send you a patch that you can use to rebuild your source RPM with.

Thanks,
Kirby

Quoted 11 lines

Thanks in advance for feedback/suggestions.

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

_______________________________________________
linux-lvm mailing list
[email protected]
http://lists.sistina.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

Signature · 1 line
Real Programmers view electronic multimedia files with a hex editor.
misc/get_device_by_label.c +1 -1
diff -u -r e2fsprogs-1.26.modified/misc/get_device_by_label.c e2fsprogs-1.26/misc/get_device_by_label.c
@@ -166,7 +166,7 @@
 
 		lv_list = opendir(vdirname);
 		free(vdirname);
-		if (lv_list == NULL)
+		if (lv_list != NULL)
 			return;
 
 		while ((lv_iter = readdir(lv_list)) != 0) {
#5 lore raw
Quoted 10 lines · Kirby C. Bohling
Quoted 5 lines · Steven Dake

I wouldn't mind seeing the patches.

Thanks
-steve

Steve,

Quoted 7 lines

The patch that fixes the LVM so fsck to it works is this attached as
fsck_lvm_labels.patch.

It's a trivial one line fix. This applies to 1.26. I'm guessing it
will apply to any version of the e2fsck since then. That was the earliest version that it did work on. It applies cleanly on 1.32 which is the latest version on sourceforge.

Steve,

Ted Ts'o, just replied to my patch, and said that my one line fix, was
backwards. I did the diff in the wrong order. I applied the patch, and it applied cleanly 1.32, but of course I didn't test it, it applied cleanly. The proper fix was added in 1.29 according to Ted. So all of the current mount and fsck programs should work properly with LVM. The trival fix is easy to see if you need to fix up the old code.

Some days I'm just a really bad programmer...

Thanks,
Kirby

Signature · 1 line
Real Programmers view electronic multimedia files with a hex editor.