Maverick alternate installer corrupts existing data partitions when more than one cryptswap volume is enabled (/etc/crypttab should NOT refer to /dev/dm-*)

Bug #710340 reported by Tuomas Heino
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
debian-installer (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: debian-installer

Installed Maverick on a system with LVM that had 2 swap volumes and 3 volume groups. Volume groups get detected in different order by installer and the installed system, and /etc/crypttab refers to them by sequential number.

Resulting /etc/fstab has

/dev/mapper/int-swap_2 none swap sw 0 0
/dev/mapper/ub3-swap_1 none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
/dev/mapper/cryptswap2 none swap sw 0 0

while /etc/crypttab has

# <target name> <source device> <key file> <options>
cryptswap1 /dev/dm-24 /dev/urandom swap,cipher=aes-cbc-essiv:sha256
cryptswap2 /dev/dm-11 /dev/urandom swap,cipher=aes-cbc-essiv:sha256

and after boot, one of the devices no longer refers to same partition, thus potentially causing severe data loss:

lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/foo -> ../dm-23
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/int_home -> ../dm-17
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/int_opt -> ../dm-16
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/int_root -> ../dm-14
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/int_usr -> ../dm-13
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/int_var -> ../dm-15
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/jau_home -> ../dm-21
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/jau_opt -> ../dm-19
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/jau_root -> ../dm-18
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/jau_usr -> ../dm-20
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/jau_var -> ../dm-22
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/luc_home -> ../dm-29
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/luc_opt -> ../dm-26
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/luc_root -> ../dm-25
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/luc_usr -> ../dm-28
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/luc_var -> ../dm-27
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/mav_home -> ../dm-30
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/mav_opt -> ../dm-32
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/mav_root -> ../dm-31
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/mav_usr -> ../dm-34
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/mav_var -> ../dm-33
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/int/swap_2 -> ../dm-24
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/kar/backup1u -> ../dm-12
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/kar/kar_home -> ../dm-11
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/kar/kar_opt -> ../dm-8
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/kar/kar_root -> ../dm-7
lrwxrwxrwx 1 root root 8 2011-01-30 20:18 /dev/kar/kar_usr -> ../dm-10
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/kar/kar_var -> ../dm-9
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/ub3/apt_mir -> ../dm-6
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/ub3/swap_1 -> ../dm-5
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/ub3/ub3_home -> ../dm-4
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/ub3/ub3_opt -> ../dm-1
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/ub3/ub3_root -> ../dm-0
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/ub3/ub3_usr -> ../dm-3
lrwxrwxrwx 1 root root 7 2011-01-30 20:18 /dev/ub3/ub3_var -> ../dm-2

So instead of dm-5 for swap_1, it is using dm-11 which happens to be one of the data volumes.
To avoid corrupting data, cryptswap should refer to LVM volumes by name (or UUID, if applicable).

During creation of lvm volumes for Maverick 2 volumes were first created & deleted and then all the *mav* ones above were created. Did not take notes on whether swap devices were selected before or after LVM changes.

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: debian-installer (not installed)
ProcVersionSignature: Ubuntu 2.6.35-25.44-generic 2.6.35.10
Uname: Linux 2.6.35-25-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
CheckboxSubmission: 7b44b94229fa7778a195996df229710e
CheckboxSystem: edda5d4f616ca792bf437989cb597002
Date: Sun Jan 30 22:12:17 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
MachineType: System manufacturer P5K Premium
MemoryUsage:
 total used free shared buffers cached
 Mem: 8193700 2042008 6151692 0 62340 1300300
 -/+ buffers/cache: 679368 7514332
 Swap: 0 0 0
ProcCmdLine: BOOT_IMAGE=/vmlinuz-2.6.35-25-generic root=/dev/mapper/int-mav_root ro quiet splash
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: debian-installer
dmi.bios.date: 12/10/2007
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 0504
dmi.board.asset.tag: To Be Filled By O.E.M.
dmi.board.name: P5K Premium
dmi.board.vendor: ASUSTeK Computer INC.
dmi.board.version: Rev 1.xx
dmi.chassis.asset.tag: Asset-1234567890
dmi.chassis.type: 3
dmi.chassis.vendor: Chassis Manufacture
dmi.chassis.version: Chassis Version
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvr0504:bd12/10/2007:svnSystemmanufacturer:pnP5KPremium:pvrSystemVersion:rvnASUSTeKComputerINC.:rnP5KPremium:rvrRev1.xx:cvnChassisManufacture:ct3:cvrChassisVersion:
dmi.product.name: P5K Premium
dmi.product.version: System Version
dmi.sys.vendor: System manufacturer

Revision history for this message
Tuomas Heino (iheino+ub) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in debian-installer (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.