Red Hat Bugzilla – Bug 832069
[Regression] blkid -g has no effect on RHEL6
Last modified: 2012-06-25 08:30:56 EDT
Description of problem:
blkid -g shall clean the removed block devices from the cache (/etc/blkid/blkid.tab). However, on RHEL6 invoking blkid -g on system having removed devices in the cache has no effect ($? is 0). The bug was verified with both loop device and real partition.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. dd if=/dev/zero of=/tmp/blkidloop bs=1024 count=1000
2. yes | mke2fs -T ext3 -L blkidloop -b 1024 /tmp/blkidloop
3. blkid /tmp/blkidloop
4. rm -f /tmp/blkidloop
5. blkid -g
6. grep blkidloop /etc/blkid/blkid.tab
A record similar to this is found:
<device DEVNO="0x0000" TIME="1339677331.186635" LABEL="blkidloop" UUID="ff340cb5-dc07-402f-bd7c-1c239a166dfb" TYPE="ext2">/tmp/blkidloop</device>
No record is found
Running blkid without any parameter removes the invalid entry from the cache and prints the cache contents so it can be used as a workaround.
- regression against what? .. the current behavior is pretty old
(since e2fsprogs > v1.41.4, commit fe144e11 in e2fsprogs tree and commit
1de91705 in util-linux tree)
- the -g options is there for backward compatibility only than
for anything useful
- blkid.tab is *private* libblkid cache file, it's not API. The file and
arbitrary functionality around the file maybe changed.
Regression against RHEL5, where the feature was introduced (and is working): https://bugzilla.redhat.com/show_bug.cgi?id=563909
If the feature have no use anymore and is present for backward compatibility only, it shall be at least stated in the documentation. Now the man page says: "-g Perform a garbage collection pass on the blkid cache to remove devices which no longer exist."