Bug 465660 - use /dev/disk/by-id in /etc/crypttab by default in anaconda
Summary: use /dev/disk/by-id in /etc/crypttab by default in anaconda
Keywords:
Status: CLOSED DUPLICATE of bug 474710
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: 10
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Lehman
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-05 10:19 UTC by Need Real Name
Modified: 2008-12-05 09:54 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-12-05 09:54:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Need Real Name 2008-10-05 10:19:08 UTC
Using /dev entries is prone to error. Ubuntu supports UUIDs. It would be good if Fedora supported UUIDs and labels.

Comment 1 Till Maas 2008-10-05 10:48:06 UTC
Can you provide a link to the patch you want to get included? Do you know what it's upstream status it?

You can also use /dev/disk/by-{id,label,path,uuid}

I can use pam_mount which runs cryptsetup using a /dev/disk/by-id device specification. I also doupt, that it is really useful to add the support for UUID/labels to every command that operates on disk devices, because /dev/disk already makes it possible for every such command.

Comment 2 Till Maas 2008-10-05 10:51:04 UTC
Uh, I just noticed that only a minor fraction of all uuids of filesystems/devices that appear running blkid are shown in /dev/disk/by-uuid. It seems that devices from lvm are not shown there, which is probably something that should be fixed.
I only checked for Fedora 8 yet, maybe it is fixed in newer releases.

Comment 3 Need Real Name 2008-10-05 10:53:59 UTC
Yes Ubuntu uses the
 /dev/disk/by-{id,label,path,uuid}
format.

I will adjust the bug title.

Comment 4 Till Maas 2008-11-02 11:38:19 UTC
(In reply to comment #3)
> Yes Ubuntu uses the
>  /dev/disk/by-{id,label,path,uuid}
> format.
> 
> I will adjust the bug title.

Can you please explain where you want to have cryptsetup use the /dev/disk/by-* format? Do you maybe want the installer to create such entries in /etc/crypttab? Please explain in detail what you did, what happened and what you expected.

Comment 5 Need Real Name 2008-11-02 19:25:14 UTC
You want me to explain the move away from changeable disk device names to unique static labels or disk identifiers?

Comment 6 Till Maas 2008-11-02 19:47:49 UTC
(In reply to comment #5)
> You want me to explain the move away from changeable disk device names to
> unique static labels or disk identifiers?

No, I want you to explain where to want to have cryptsetup use the /dev/disk/by-* format and hat you did, what happened and what
you expected, that made you create this bug report. For me this works:

cryptsetup luksOpen /dev/disk/by-uuid/28aa012c-8f04-4e00-9d01-4e2a7dd1ff6d /mnt/foo/

Therefore your bug report does not make much sense to me.

Comment 7 Need Real Name 2008-11-02 19:54:18 UTC
> Do you maybe want the installer to create such entries in /etc/crypttab

Yes I do, sorry missed this.

Comment 8 Till Maas 2008-11-02 20:46:15 UTC
(In reply to comment #7)
> > Do you maybe want the installer to create such entries in /etc/crypttab
> 
> Yes I do, sorry missed this.

Ok, then this needs to be assigned to anaconda, because that's the installer. Here in summary for the anaconda maintainers:

Anaconda should use /dev/disk/by-id/[1] entries for /etc/crypttab by default for encrypted partitions instead of using direct device names like /dev/sda1, because these can change arbitrarily.


[1] Afaics is /dev/disk/by-id always unique as long as hard disk manufacturers do not asign serial numbers twice to hard disks, whereas labels or uuids have a much higher probability to collide.

Comment 9 David Lehman 2008-11-03 15:28:52 UTC
We have been using UUIDs in crypttab since anaconda-11.4.1.34-1, which I believe was included in the F10-Beta.

Comment 10 Till Maas 2008-11-03 22:42:16 UTC
(In reply to comment #9)
> We have been using UUIDs in crypttab since anaconda-11.4.1.34-1, which I
> believe was included in the F10-Beta.

I just installed a F10 Snap3 i386 and these are my findings:

1) Using UUIDs instead of device ids is probably a better choice wrt. usability, because one can then easier dd a disk image to another harddisk and boot from it.

2) For encrypted root fs, /etc/crypttab is not the problem (which contains a UUID for the lvm containing itself). I am not even sure, whether the /etc/crypttab make s sense here ;-)

3) The initramfs uses a hardcoded /dev/sda2 instead of a UUID, which afaics renders the UUID approach useless currently. It is probably a problem that udev is not included in the initramfs and therefore the /dev/disk/by-* devices do not currently exist.
Easy test command:

lsinitrd /boot/initrd* | grep cryptsetup


4) I should have probably also setup a seperate luks partitions to see how it is generated and included in the FS.


Currently I would conclude that currently mkinitrd should be improved to use UUIDs somehow (which may either require a patch for cryptsetup or some udev in the initramfs) to fix this issue that I described in 3) and is maybe also the problem the reported noticed.

Comment 11 Bug Zapper 2008-11-26 03:34:21 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 12 Till Maas 2008-12-05 09:54:07 UTC
I believe that there is nothing to fix in anaconda regarding this issue. There was also a new bug reported about this with obviously less comments, which is therefore more clear, I close this bug report.

*** This bug has been marked as a duplicate of bug 474710 ***


Note You need to log in before you can comment on or make changes to this bug.