Bug 465660 - use /dev/disk/by-id in /etc/crypttab by default in anaconda
use /dev/disk/by-id in /etc/crypttab by default in anaconda
Status: CLOSED DUPLICATE of bug 474710
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
10
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Lehman
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-05 06:19 EDT by Need Real Name
Modified: 2008-12-05 04:54 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-12-05 04:54:07 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2008-10-05 06:19:08 EDT
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 06:48:06 EDT
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 06:51:04 EDT
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 06:53:59 EDT
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 06:38:19 EST
(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 14:25:14 EST
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 14:47:49 EST
(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 14:54:18 EST
> 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 15:46:15 EST
(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 10:28:52 EST
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 17:42:16 EST
(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-25 22:34:21 EST
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 04:54:07 EST
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.