[pkg-cryptsetup-devel] Bug#671037: Bug#671037: can not change target name of root in /etc/crypttab

Jonas Meurer jonas at freesources.org
Fri Jun 8 10:01:59 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

severity 671037 wishlist
thanks

Hey Adam,

you're right, there's no easy way to rename the target name of your
encrypted rootfs without breaking initramfs stuff. Unfortunately
there's no easy way to implement support for it either.

The function add_device() in cryptroot initramfs hook script uses the
target name for a reason, only target device is available from /etc/fstab.

And one could as well argument the other way around: currently it's
easier to change the source device after moving to another
disk/partition, that would be more complicated if the source device
was source for information in add_device().

To be honest, I don't consider renaming target name a important
feature. Feel free to provide patches that implement support for it if
you disagree.

Another option would be to document the limitation and your workaround
in README.Debian. What do you think about that?

Regards,
 jonas

Am 01.05.2012 14:51, schrieb Adam Lee:
> Package: cryptsetup Version: 2:1.4.1-3 Severity: important
> 
> Hi,
> 
> I use LVM over LUKS, I got the warning below when I run 
> `update-initramfs -u` after the target name changed.
> 
> cryptsetup: WARNING: invalid line in /etc/crypttab for sys - 
> cryptsetup: WARNING: invalid line in /etc/crypttab for sys -
> 
> And reboot failed(BTW, `ln -s /dev/dm-0 /dev/mapper/NEWNAME`
> dosen't work).
> 
> Yes, I found a way(by which I changed the name from sda2_crypt to
> sys and successfully boot):
> 
> 0, enter another system(like livecd) 1, luksOpen with the new name,
> change the target name to the new one 2, chroot into it(now, the
> living target name is the same as it in conf) 3, update-initramfs
> -u 4, reboot
> 
> IMO, the func "add_device" in
> /usr/share/initramfs-tools/hooks/cryptroot should not get root
> options from target, it should get those options from source.
> 
> 
> -- Package-specific info: -- /proc/cmdline 
> BOOT_IMAGE=/vmlinuz-3.2.0-2-amd64 root=/dev/mapper/sys-root ro
> quiet
> 
> -- /etc/crypttab # <target name>	<source device>		<key file>
> <options> sys /dev/sda2 none luks
> 
> -- /etc/fstab # /etc/fstab: static file system information. # # Use
> 'blkid' to print the universally unique identifier for a # device;
> this may be used with UUID= as a more robust way to name devices #
> that works even if disks are added and removed. See fstab(5). # #
> <file system> <mount point>   <type>  <options>       <dump>
> <pass> proc            /proc           proc    defaults        0
> 0 /dev/sda1       /boot           ext4    defaults        0
> 2 /dev/mapper/sys-swap none       swap    sw              0
> 0 /dev/mapper/sys-root /          ext4    errors=remount-ro 0
> 1 /dev/mapper/sys-home /home      ext4    defaults        0
> 2 /dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0
> 0
> 
> -- lsmod Module                  Size  Used by pci_stub
> 12429  1 vboxpci                19066  0 vboxnetadp
> 13155  0 vboxnetflt             23571  0 vboxdrv
> 190057  3 vboxnetflt,vboxnetadp,vboxpci tun
> 18337  2 fuse                   61981  1 nfsd
> 211858  2 nfs                   312191  0 nfs_acl
> 12511  2 nfs,nfsd auth_rpcgss            37143  2 nfs,nfsd fscache
> 36739  1 nfs lockd                  67328  2 nfs,nfsd sunrpc
> 173671  6 lockd,auth_rpcgss,nfs_acl,nfs,nfsd cpufreq_conservative
> 13147  4 acpi_cpufreq           12935  1 mperf
> 12453  1 acpi_cpufreq loop                   22641  0 firewire_sbp2
> 17993  0 snd_hda_codec_hdmi     30783  4 arc4
> 12458  2 snd_hda_codec_conexant    45199  1 iwlwifi
> 166657  0 snd_hda_intel          26345  1 snd_hda_codec
> 78031  3 snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec_hdmi 
> snd_hwdep              13186  1 snd_hda_codec snd_pcm_oss
> 41081  0 mac80211              192768  1 iwlwifi snd_mixer_oss
> 17916  2 snd_pcm_oss snd_pcm                63900  4
> snd_pcm_oss,snd_hda_codec,snd_hda_intel,snd_hda_codec_hdmi 
> snd_page_alloc         13003  2 snd_pcm,snd_hda_intel snd_seq_midi
> 12848  0 snd_seq_midi_event     13316  1 snd_seq_midi cfg80211
> 137140  2 mac80211,iwlwifi snd_rawmidi            23060  1
> snd_seq_midi joydev                 17266  0 thinkpad_acpi
> 61270  0 snd_seq                45093  2
> snd_seq_midi_event,snd_seq_midi iTCO_wdt               17081  0 
> nouveau               545197  2 ttm                    48725  1
> nouveau drm_kms_helper         27227  1 nouveau drm
> 167670  4 drm_kms_helper,ttm,nouveau i2c_i801               16870
> 0 nvram                  13049  1 thinkpad_acpi snd_seq_device
> 13176  3 snd_seq,snd_rawmidi,snd_seq_midi rfkill
> 19012  2 thinkpad_acpi,cfg80211 snd_timer              22917  2
> snd_seq,snd_pcm i2c_algo_bit           12841  1 nouveau snd
> 52850  13
> snd_timer,snd_seq_device,snd_seq,thinkpad_acpi,snd_rawmidi,snd_pcm,snd_mixer_oss,snd_pcm_oss,snd_hwdep,snd_hda_codec,snd_hda_intel,snd_hda_codec_conexant,snd_hda_codec_hdmi
>
> 
i2c_core               23876  5
i2c_algo_bit,i2c_i801,drm,drm_kms_helper,nouveau
> tpm_tis                17454  0 tpm                    17862  1
> tpm_tis psmouse                64455  0 iTCO_vendor_support
> 12704  1 iTCO_wdt intel_ips              17603  0 soundcore
> 13065  2 snd mxm_wmi                12473  1 nouveau wmi
> 13243  1 mxm_wmi tpm_bios               12948  1 tpm serio_raw
> 12931  0 evdev                  17562  17 pcspkr
> 12579  0 battery                13109  0 button
> 12937  1 nouveau video                  17628  1 nouveau ac
> 12624  0 processor              28106  1 acpi_cpufreq power_supply
> 13475  2 ac,battery ext4                  350411  3 crc16
> 12343  1 ext4 jbd2                   62015  1 ext4 mbcache
> 13065  1 ext4 sha256_generic         16797  2 aesni_intel
> 50667  13 cryptd                 14517  5 aesni_intel aes_x86_64
> 16796  1 aesni_intel aes_generic            33026  2
> aes_x86_64,aesni_intel cbc                    12754  0 dm_crypt
> 22586  1 dm_mod                 63545  12 dm_crypt sr_mod
> 21899  0 sd_mod                 36136  3 cdrom
> 35401  1 sr_mod crc_t10dif             12348  1 sd_mod sdhci_pci
> 17976  0 sdhci                  27053  1 sdhci_pci mmc_core
> 72460  2 sdhci,sdhci_pci ahci                   24997  2 libahci
> 22860  1 ahci firewire_ohci          35772  0 ehci_hcd
> 40215  0 firewire_core          48407  2
> firewire_ohci,firewire_sbp2 e1000e                124918  0 thermal
> 17383  0 thermal_sys            18040  3 thermal,processor,video 
> crc_itu_t              12347  1 firewire_core libata
> 140589  2 libahci,ahci scsi_mod              162458  4
> libata,sd_mod,sr_mod,firewire_sbp2 usbcore               128498  2
> ehci_hcd usb_common             12354  1 usbcore
> 
> 
> -- System Information: Debian Release: wheezy/sid APT prefers
> unstable APT policy: (500, 'unstable'), (500, 'testing'), (1,
> 'experimental') Architecture: amd64 (x86_64)
> 
> Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores) Locale:
> LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell:
> /bin/sh linked to /bin/dash
> 
> Versions of packages cryptsetup depends on: ii  debconf
> [debconf-2.0]  1.5.42 ii  dmsetup                2:1.02.67-2 ii
> libc6                  2.13-31 ii  libcryptsetup4
> 2:1.4.1-3 ii  libpopt0               1.16-3
> 
> cryptsetup recommends no packages.
> 
> Versions of packages cryptsetup suggests: ii  busybox
> 1:1.19.3-7 ii  dosfstools                              3.0.12-1 ii
> initramfs-tools [linux-initramfs-tool]  0.102 ii
> liblocale-gettext-perl                  1.05-7+b1 ii  udev
> 175-3.1
> 
> -- debconf information: cryptsetup/prerm_active_mappings: true
> 
> 
> 
> _______________________________________________ 
> pkg-cryptsetup-devel mailing list 
> pkg-cryptsetup-devel at lists.alioth.debian.org 
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-cryptsetup-devel
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJP0c2OAAoJEFJi5/9JEEn+fywQAL7oJv/m/wJdWCLP6yqpL3M5
TCl1okK+MTqr08emxfZkLOSIK5dvd2tWBOWdDsM4/jhdvDdMxlX1BTJIYAlesO5y
DvClMemBhxJRdtQ3b83smV8Xm9e78ZH4FvqvqNuNDwY/gx7OmAXAtCos9DFeaBZA
KVJSm/7WhFZ61gRAiL/KTTRtSYqpTLwavXUuiwR1oYmJNGH9BEz/rnMQH6RgWEox
g/4L4UFpVGjWpr/A+wyEAgKrtOYNtNYHoofTingzqy9smfwd1WzYEWvlYMfw2/MD
W53AYY2rqwrDE0F2tb7rUTSwtKEFiC/BPFVBpo+NiADdWuHxfSlR7rrdmwTzKvnG
GQp2GooPMRdMtP+ply2yM2GU+iYG1lYbqY8UMUAB6pBQCM330csd16Zi8sW/diIw
aL4tmLP5lfmp7VGT5ox5212aYx8Zol54+/GTbFYw5bCX4b2AFzs6xV5gYuCAyhBv
Am1pF+WWfQbopne87PqiCH9uW40TNYs1oBgLLMGpQTwXBSm+fYTmddojl2UNQRJD
VUtJ89bZfmnWhsHeveeX9DRWb3+J5XKzylSiShxixBnrrK30tgQegtylNfqLChEs
EzMHjxzMyiLQAq1cibo2aeqdRYyaOgfYeV60bNhAfTIfWaWfIJ+G5+cE60Ia/S5/
M5xM/Vwp6kNgmdV6t7MT
=6P5S
-----END PGP SIGNATURE-----





More information about the pkg-cryptsetup-devel mailing list