lvrename fails to clear blkid cache
Isaac M. Marcos
isaacmarcos at gmx.com
Mon Aug 11 17:36:30 UTC 2008
Hello:
I found a problem that I'm not shure to report as a bug, I would like your input to asscertain that it is indeed worth filing a bug.
Short description:
On using lvrename with UUID I get a failure to mount a "logical volume".
As I understand, the sequence to rename a "logical volume" should be:
umount /dev/VG4/test
lvrename /dev/VG4/test /dev/VG4/newtest
mount -a
The mount command fails with a " the special device UUID=(...) doesn't exist."
Conditions:
kernel: Linux 2.6.25-2-amd64 #1 SMP GNU/Linux
OS: Debian testing
lvm2 version: 2.02.39-2
Detailed sequence:
fstab contains only one line related to the partition:
zeus:/home#cat /etc/fstab | grep test
UUID=5e5c9ec4-b8d7-4670-a71a-54d1aee6632a /home/test ext3 defaults,acl 0 9
Mount works without a problem:
zeus:/home#mount -a
The "logical volume" is correctly mounted:
zeus:/home#mount | grep test
/dev/mapper/VG4-Ltest on /home/test type ext3 (rw,acl)
The "logical volume" is correct:
zeus:/home# lvs | grep test
Ltest VG4 -wi-a- 24,56G
lvrename works correctly:
zeus:/home# lvrename VG4 Ltest Ltes
Renamed "Ltest" to "Ltes" in volume group "VG4"
Mount the affected volume fails to work:
zeus:/home# mount -a
mount: the special device UUID=5e5c9ec4-b8d7-4670-a71a-54d1aee6632a doesn't exist.
Being at this point in a very limited time window I opted to erase the failing volume and recreated it with a new
name, leaving for latter finding what the real problem was.
After recreating the situation with a new volume, I got conviced this was a "real" problem and not a failure on my part.
To find "what" was the real problem, got me into looking for what/who was making the UUID of the device fail.
Detail of some info after the lvrename:
The "logical volume" exists:
zeus:/home# lvs | grep Ltes
Ltes VG4 -wi-a- 24,56G
The "logical volume" is ACTIVE:
zeus:/home# lvscan | grep Ltes
ACTIVE '/dev/VG4/Ltest' [24,56 GB] inherit
The "logical volume" is correctly allocated:
zeus:/home# lvdisplay
--- Logical volume ---
LV Name /dev/VG4/Ltest
VG Name VG4
LV UUID zGwUqV-Ckn4-hJuV-KdYG-Ub2Q-ibl6-FBghTP
LV Write Access read/write
LV Status available
# open 0
LV Size 24,56 GB
Current LE 6288
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:12
The UUID of the corresponding ext3 filesystem is correct:
zeus:/home# dumpe2fs /dev/VG4/Ltes
dumpe2fs 1.41.0 (10-Jul-2008)
Filesystem UUID: 5e5c9ec4-b8d7-4670-a71a-54d1aee6632a
Q: So, why this "logical volume" fails to mount with "mount -a"?
Finally I discovered that there is a cache system for UUID provided by blkid.tab
Erasing the failing line on that file corrected the problem. Or making a "blkid -g" could work as well.
A: blkid.tab is holding a stale line with wrong info.
Erase the line in blkid.tab:
zeus:/home#vi /etc/blkid.tab --> eliminate line with Ltest
Make blkid re-scan the devices:
zeus:/home#blkid | grep Ltes
/dev/mapper/VG4-Ltes: UUID="5e5c9ec4-b8d7-4670-a71a-54d1aee6632a" SEC_TYPE="ext2" TYPE="ext3"
And "mount -a" works correctly.
Conclusion:
lvrename should erase any reference to the name it is making unavailable from blkid.tab
Could we spare others to have the same problems?
Thanks for your attention in advance.
--
Isaac M. Marcos
More information about the pkg-lvm-maintainers
mailing list