[dm-crypt] Encrypt all partitions with dm-crypt

Matthew Monaco dgbaley27 at 0x01b.net
Wed Sep 26 13:13:31 CEST 2012


On 09/26/2012 04:49 AM, Stayvoid wrote:
>> You can mount to wherever you like. Once you've mapped the block
>> device to /dev/mapper/NAME, you have a block device like any other.
> 
> Will the following work from a recovery shell?
> 
> # mkdir media
> # mount /dev/mapper/main /media
> # mount -t proc none /media/proc
> # mount --rbind /dev /media/dev
> # mount --rbind /sys /media/sys
> # mount /dev/sda1 /boot
> 
> There is no /bin/bash. Can I use ash?
> 
> # chroot /media /bin/ash

Has it occurred to you to just try these things? We're getting a bit off topic
here...

That will work, assuming you mapped something to /dev/mapper/main with
cryptsetup already. Also, I think you meant /media/boot. Also, /mnt should be
available, no reason to insist on media.

ash is fine, it's what is provided by busybox in the initramfs.

I usually do:

# mount /dev/mapper/main /mnt
# mount /dev/sda1 /mnt/boot
# for m in dev proc sys; do mount --bind /$m /mnt/$m; done
# chroot /mnt


More information about the dm-crypt mailing list