Skip to contentSkip to conversation

vol_id doesn't recognize unjournaled ext4

DISCUSSION Andre Beck 3 participants 3 messages Mar 14, 2009 – Mar 17, 2009

lore
Share & tools
lore

Andre Beck

author
#0 lore raw

Hi,

fooling around with a Debian Sid/Experimental installation on a USB flash drive, I had some boot issues as /dev/disk/by-{uuid,label} showed no trace of my boot partition. I've tracked this to vol_id not recognizing an ext4 block device if the ext4 doesn't have a journal (a feature that was added to ext4 as an afterthought for the flash drive use case). The code in ext.c makes pretty clear why that happens, it will only go into the ext3 branch if there is a journal in the first place, and will only recognize ext4 as incompatible features on top of ext3 in that branch.

BTW, util-linux mount(8) apparently has the same issue, as it doesn't autodetect an unjournaled ext4 and insists on "-t ext4" to mount it.

I'm not on the list, so please keep me Cc'ed on this thread (if any).

Thanks,
Andre.

Signature · 1 line
-> Andre Beck    +++ ABP-RIPE +++   "Signatures are so last century" <-
#1 lore raw
Quoted 10 lines · Andre Beck

fooling around with a Debian Sid/Experimental installation on a USB flash drive, I had some boot issues as /dev/disk/by-{uuid,label} showed no trace of my boot partition. I've tracked this to vol_id not recognizing an ext4 block device if the ext4 doesn't have a journal (a feature that was added to ext4 as an afterthought for the flash drive use case). The code in ext.c makes pretty clear why that happens, it will only go into the ext3 branch if there is a journal in the first place, and will only recognize ext4 as incompatible features on top of ext3 in that branch.

Quoted 2 lines

BTW, util-linux mount(8) apparently has the same issue, as it doesn't autodetect an unjournaled ext4 and insists on "-t ext4" to mount it.

No, libvolume_id does not support it.

Libvolume_id and blkid got merged and major parts got rewritten by Karel and we have a new libblkid in util-linux-ng now. We are on the way to switch udev over to it during the next month. Libvolume_id and vol_id will no longer be used and deleted from the udev tree.

If you like it detected now, you could provide a patch for it, but it's unlikely, that it will hit a distro release before we replaced it with libblkid, which supports it already.

Thanks,
Kay

#2 lore raw
In reply to Andre Beck
Quoted 11 lines · Kay Sievers
Quoted 10 lines · Andre Beck

fooling around with a Debian Sid/Experimental installation on a USB flash drive, I had some boot issues as /dev/disk/by-{uuid,label} showed no trace of my boot partition. I've tracked this to vol_id not recognizing an ext4 block device if the ext4 doesn't have a journal (a feature that was added to ext4 as an afterthought for the flash drive use case). The code in ext.c makes pretty clear why that happens, it will only go into the ext3 branch if there is a journal in the first place, and will only recognize ext4 as incompatible features on top of ext3 in that branch.

Quoted 2 lines
Quoted 2 lines

BTW, util-linux mount(8) apparently has the same issue, as it doesn't autodetect an unjournaled ext4 and insists on "-t ext4" to mount it.

Currently mount(8) depends on libblkid version from e2fsprogs.

The problem has been fixed in the upstream e2fsprogs tree, patches:

    a90f5391dda78f7bc4a8196a78355584ace0adf5
    1361821e7e248166f0740c832b164e6cd6b89de9

You need to port the change to your Debian e2fsprogs package ...or wait for a new upstream release.

Quoted 8 lines

No, libvolume_id does not support it.

Libvolume_id and blkid got merged and major parts got rewritten by Karel and we have a new libblkid in util-linux-ng now. We are on the way to switch udev over to it during the next month. Libvolume_id and vol_id will no longer be used and deleted from the udev tree.

If you like it detected now, you could provide a patch for it, but

That's a trivial patch, see below (blkid version).

Karel

commit be221b3a9d4b2a0be90d9c12ddb7f8ece568b2f9

Author: Eric Sandeen <[email protected]>
Date:   Mon Mar 9 12:17:17 2009 +0100

blkid: recognize ext4(dev) without journal

ext4/ext4dev no longer require a journal.

w/o this blkid doesn't recognize after:

We still must have one ext3-incompat-feature to flag as ext4(dev) so we shouldn't ever mis-recognize it.

[[email protected]: port from e2fsprogs to util-linux-ng tree]

libs/blkid/src/probers/ext.c +0 -8
index ff0e51b..ca90f31 100644
@@ -417,10 +417,6 @@ static int probe_ext4dev(blkid_probe pr, const struct blkid_idmag *mag)
 	if (fi & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
 		return -BLKID_ERR_PARAM;
 
-	/* ext4dev requires a journal */
-	if (!(fc & EXT3_FEATURE_COMPAT_HAS_JOURNAL))
-		return -BLKID_ERR_PARAM;
-
 	/*
 	 * If the filesystem is marked as OK for use by in-development
 	 * filesystem code, but ext4dev is not supported, and ext4 is,
@@ -454,10 +450,6 @@ static int probe_ext4(blkid_probe pr, const struct blkid_idmag *mag)
 	if (fi & EXT3_FEATURE_INCOMPAT_JOURNAL_DEV)
 		return -BLKID_ERR_PARAM;
 
-	/* ext4 requires journal */
-	if (!(fc & EXT3_FEATURE_COMPAT_HAS_JOURNAL))
-		return -BLKID_ERR_PARAM;
-
 	/* Ext4 has at least one feature which ext3 doesn't understand */
 	if (!(frc & EXT3_FEATURE_RO_COMPAT_UNSUPPORTED) &&
 	    !(fi  & EXT3_FEATURE_INCOMPAT_UNSUPPORTED))