- Package:
- partman-base
- Source:
- partman-base
- Submitter:
- Martin Michlmayr
- Date:
- 2015-08-06 15:06:06 UTC
- Severity:
- normal
Several users reported that /dev/disk/by-uuid is not updated when d-i creates an ext2 filesystem. This problem does not happen when you create an ext3 or ext4 filesysten. I noticed that d-i uses parted to create ext2 filesystems whereas ext3 and ext4 filesystems are created by running mkfs.ext[34]. I ran parted mkfs outside of d-i and the /dev/disk/by-uuid was created. Looking at partman server, it seems to run: command_create_file_system timered_file_system_create ped_file_system_create whereas parted is like this: do_mkfs ped_file_system_create .... ped_disk_commit ped_disk_commit sounds like a command that informs the OS of the change. Maybe this function would trigger udev to update the /dev/disk/by-uuid link? Note that I don't know anything about parted, so maybe this hypothesis is completely wrong, but there's certainly a problem somewhere. This bug is easy to reproduce: boot d-i, enter partman, create one partition with ext2 and one with ext3. Then check /dev/disk/by-uuid and you'll see there's a link for the ext3 but no link for the ext2 partition.
Another example of this bug is #701223, which was closed because of too little info.
Here's a workaround for partman-basicfilesystem but obviously it would be nice if this could get fixed properly. diff --git a/commit.d/format_basicfilesystems b/commit.d/format_basicfilesystems index 2b24dee..4a572ca 100755 --- a/commit.d/format_basicfilesystems +++ b/commit.d/format_basicfilesystems @@ -61,6 +61,13 @@ for dev in $DEVICES/*; do read_line status close_dialog sync + # Create link in /dev/disk/by-uuid + dev=$(basename $device) + uuid=$(blkid $device -s UUID -o value) + if [ -n "$uuid" ]; then + rm -f /dev/disk/by-uuid/$uuid + ln -s ../../$dev /dev/disk/by-uuid/$uuid + fi else status=failed fi
Very clever! =) i think to be honest, this is good enough. Regards, Dmitrijs.
21:59 < tbm> cjwatson_: what do you think of my hack in #729445 22:08 < cjwatson> tbm: This has all changed around since you posted that; partman no longer uses parted's fs handling code (which itself no longer exists) 22:09 < tbm> cjwatson: do you think the bug is gone then? 22:09 < cjwatson> tbm: Certainly (now that I've dug up enough patch context) the case you're patching no longer exists at all. 22:09 < cjwatson> Definitely worth retesting if you have a test case 22:10 < tbm> cjwatson: cool, will add it to my todo list