From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ew0-f219.google.com (mail-ew0-f219.google.com [209.85.219.219]) by mail.saout.de (Postfix) with ESMTP for ; Sun, 21 Feb 2010 05:42:43 +0100 (CET) Received: by ewy19 with SMTP id 19so1402237ewy.1 for ; Sat, 20 Feb 2010 20:42:41 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20100220085539.GA4809@resivo.wgnet.de> References: <6294c32a1002171625m77251de0pd665b2cf0c4983ac@mail.gmail.com> <20100220085539.GA4809@resivo.wgnet.de> Date: Sat, 20 Feb 2010 23:42:40 -0500 Message-ID: <6294c32a1002202042i7640ebbrd9899c5bfb33b49c@mail.gmail.com> From: Selim Levy Content-Type: multipart/alternative; boundary=000e0cdf986c6cb5b8048014f23f Subject: Re: [dm-crypt] configuration files List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Selim Levy , dm-crypt@saout.de --000e0cdf986c6cb5b8048014f23f Content-Type: text/plain; charset=ISO-8859-1 Hi, Thank you very much for your help. I'm almost there, I think. On 20 February 2010 03:55, Jonas Meurer wrote: > hey sven, > > On 17/02/2010 Selim Levy wrote: > > The cause: > > During the CD installation of debian, the debian installer associates the > > external hard drive to /dev/sdb. However, following the installation, > when > > I boot *from* the external hard drive, the system associates it with > > /dev/sda. So essentially, I'm installing linux (and dm-crypt and > everything > > else) to /dev/sdb, though it will then be called /dev/sda when I boot > from > > it. > > > > The question: > > I've already made the necessary changes to GRUB and the /boot partition > is > > booting properly -- I can get a busybox prompt -- but I'm unable to > continue > > booting into the root partition. Where are the files on /boot located > that > > must be changed in order for the boot partition to properly deal with the > > dm-crypt encrypted LVM volume group? I have already found the > > conf/conf.d/cryptroot file within my initrd image and have modified both > > lines in it. (One line is for the root partition, the other for swap.) > > I've modified the 'target=' and the 'source=' entries (on both llines) to > > show 'sda3' as opposed to the original 'sdb3'. What else must be > changed? > > you need to change both /etc/crypttab and /etc/fstab on the rescue > system, and maybe even /etc/initramfs-tools/conf.d/resume. > afterwards you'll have to regenerate the initramfs image. the best way > to do so is to: > - unlock and mount the rootfs of your rescue system to /mnt/rescue > - copy /proc/modules, /proc/cmdline and /proc/devices to > /mnt/rescue/proc > - bind-mount /dev to /mnt/rescue/dev: 'mount -o bind /dev /mnt/rescue/dev' > - chroot into /mnt/rescue/dev > - modify /proc/cmdline, /etc/crypttab and /etc/fstab > - run 'update-initramfs -u' > Just in case I had screwed things up myself prior to your reply and my new attempts, I reinstalled Debian lenny onto the external USB drive (which I call "rescue" or "external"). I booted back into my internal drive and attempted all of your recommendations on the external drive: # cryptsetup luksOpen /dev/sdc3 rescue # vgchange -a y rescue # mount /dev/rescue/rooto /mnt/RootRescue/ # mount /dev/sdc2 /mnt/RootRescue/boot/ # mount -o bind /dev /mnt/RootRescue/dev However, when I get to updating my initramfs, I get the following error: # chroot /mnt/RootRescue/ /usr/sbin/update-initramfs -u update-initramfs: Generating /boot/initrd.img-2.6.26-2-amd64 cryptsetup: WARNING: invalid line in /etc/crypttab - cryptsetup: WARNING: invalid line in /etc/crypttab - The contents of the rescue's /etc/crypttab, for which I've tried various things is: # cat crypttab sdb3_crypt /dev/sdb3 none luks I wonder whether my problem is related to which drive gets /dev/sdx designation based upon which one booted. When booted on my usual/internal drive and with /dev still bind-mounted (above), I have /mnt/RootRescue/dev/sda and ..../sdc well populated. Nothing about sdb. When I try to boot from the external drive, I get lots of sdb output (particularly if I boot into "rescue" mode). Don't know if that helps any... Thanks in advance for your assistance. Cheers, S --000e0cdf986c6cb5b8048014f23f Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,

Thank you very much for your help.=A0 I'm almost there, I th= ink.


On 20 February 2010 03:55, Jonas= Meurer <jona= s@freesources.org> wrote:
hey sven,

On 17/02/2010 Selim Levy wrote:
> The cause:
> During the CD installation of debian, the debian installer associates = the
> external hard drive to /dev/sdb. =A0However, following the installatio= n, when
> I boot *from* the external hard drive, the system associates it with > /dev/sda. =A0So essentially, I'm installing linux (and dm-crypt an= d everything
> else) to /dev/sdb, though it will then be called /dev/sda when I boot = from
> it.
>
> The question:
> I've already made the necessary changes to GRUB and the /boot part= ition is
> booting properly -- I can get a busybox prompt -- but I'm unable t= o continue
> booting into the root partition. =A0Where are the files on /boot locat= ed that
> must be changed in order for the boot partition to properly deal with = the
> dm-crypt encrypted LVM volume group? =A0I have already found the
> conf/conf.d/cryptroot file within my initrd image and have modified bo= th
> lines in it. =A0(One line is for the root partition, the other for swa= p.)
> I've modified the 'target=3D' and the 'source=3D' = entries (on both llines) to
> show 'sda3' as opposed to the original 'sdb3'. =A0What= else must be changed?

you need to change both /etc/crypttab and /etc/fstab on the rescue system, and maybe even /etc/initramfs-tools/conf.d/resume.
afterwards you'll have to regenerate the initramfs image. the best way<= br> to do so is to:
- unlock and mount the rootfs of your rescue system to /mnt/rescue
- copy /proc/modules, /proc/cmdline and /proc/devices to
=A0/mnt/rescue/proc
- bind-mount /dev to /mnt/rescue/dev: 'mount -o bind /dev /mnt/rescue/d= ev'
- chroot into /mnt/rescue/dev
- modify /proc/cmdline, /etc/crypttab and /etc/fstab
- run 'update-initramfs -u'


Just in ca= se I had screwed things up myself prior to your reply and my new attempts, = I reinstalled Debian lenny onto the external USB drive (which I call "= rescue" or "external").

I booted back into my internal drive and attempted all of your recommen= dations on the external drive:

<output for following omitted beca= use no errors>
# cryptsetup luksOpen /dev/sdc3 rescue
# vgchange -= a y rescue
# mount /dev/rescue/rooto /mnt/RootRescue/
# mount /dev/sdc2 /mnt/RootRe= scue/boot/
# mount -o bind /dev /mnt/RootRescue/dev


However, = when I get to updating my initramfs, I get the following error:

# chroot /mnt/RootRescue/ /usr/sbin/update-initramfs -u
update-initramfs= : Generating /boot/initrd.img-2.6.26-2-amd64
cryptsetup: WARNING: invali= d line in /etc/crypttab -
cryptsetup: WARNING: invalid line in /etc/cryp= ttab -

The contents of the rescue's /etc/crypttab, for which I've trie= d various things is:
# cat crypttab
sdb3_crypt /dev/sdb3 none luks

I wonder whether my problem is related to which drive gets /dev/sd= x designation based upon which one booted.=A0 When booted on my usual/inter= nal drive and with /dev still bind-mounted (above), I have /mnt/RootRescue/= dev/sda and ..../sdc well populated.=A0 Nothing about sdb.=A0 When I try to= boot from the external drive, I get lots of sdb output (particularly if I = boot into "rescue" mode).=A0 Don't know if that helps any...<= br>
Thanks in advance for your assistance.

Cheers,
S


<= br>
=A0
--000e0cdf986c6cb5b8048014f23f--