All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jtlayton@poochiereds.net>
To: linux-lvm@redhat.com
Subject: [linux-lvm] Patch for Miguel Cabeça's lvm2create_initrd script
Date: Tue Mar  9 21:03:04 2004	[thread overview]
Message-ID: <1078884314.2919.16.camel@localhost> (raw)
In-Reply-To: <403E8A0E.9070308@ist.utl.pt>

[-- Attachment #1: Type: text/plain, Size: 1124 bytes --]

Hi all,
 I recently upgraded the kernel on my box and had an awful time getting
my old initrd image that relies on change_root() to work. I switched to
Miguel's new script and it works great, though I had to make a couple of
tweaks:

 The first one is pretty minor. I have /usr set up as a separate
partition, and debian puts chroot in /usr/sbin. Luckily, chroot is also
a busybox function, so I simply added /initrd/sbin and /initrd/bin to
the PATH so that it could find a working chroot after pivot_root occurs.

 The second one is an ugly hack, and I'm definitely open to better ways
of handling it. After my kernel upgrade (from 2.6.1 to 2.6.4-rc2), the
major number of the device mapper devices on my system changed. So, I
added a hack to copy the contents of the ramdisk /dev/mapper directory
to the /dev/mapper directory on the lvm2 root filesystem, prior to the
pivot_root. It works for me, but I'd love to hear about better ways of
handling this.

I've attached a patch to this email, or you can get the updated script
from:

http://poochiereds.net/svn/lvm2create_initrd

-- 
Jeff Layton <jtlayton@poochiereds.net>

[-- Attachment #2: lvm2create_initrd.patch --]
[-- Type: text/x-patch, Size: 998 bytes --]

Index: lvm2create_initrd.sh
===================================================================
--- lvm2create_initrd.sh        (revision 70)
+++ lvm2create_initrd.sh        (working copy)
@@ -77,7 +77,7 @@
                                                                                
 # include in the path some dirs from the real root filesystem
 # for chroot, blockdev
-PATH="/sbin:/bin:/usr/sbin:/usr/bin:/lib/lvm-200"
+PATH="/sbin:/bin:/usr/sbin:/usr/bin:/lib/lvm-200:/initrd/bin:/initrd/sbin"
 PRE="initrd:"
                                                                                
 echo "$PRE Remounting / read/write"
@@ -141,6 +141,10 @@
        return 0
 fi
                                                                                
+echo "$PRE Copying /dev/mapper devices to $rootvol"
+cd /dev
+tar cf - ./mapper | ( cd /rootvol/dev; tar xvf - )
+
 echo "$PRE Umounting /proc"
 umount /proc
                                                                                

  parent reply	other threads:[~2004-03-10  2:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-26 19:06 [linux-lvm] Another lvm2create_initrd for having a root filesystem on LVM2 Miguel Cabeça
2004-02-26 22:49 ` Kevin P. Fleming
2004-03-09 21:03 ` Jeff Layton [this message]
2004-03-10  8:25   ` [linux-lvm] Patch for Miguel Cabe?a's lvm2create_initrd script Joe Thornber
2004-03-10 11:36     ` Jeffrey Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1078884314.2919.16.camel@localhost \
    --to=jtlayton@poochiereds.net \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.