[linux-lvm] Converting my Root file system to LVM [lastquestion]

Luca Berra bluca at comedia.it
Thu May 24 19:48:49 UTC 2001


On Thu, May 24, 2001 at 09:22:25AM -0500, AJ Lewis wrote:
> On Thu, May 24, 2001 at 12:41:18AM -0600, Andreas Dilger wrote:
> > Actually, I posted a similar question to linux-kernel, but I think it was
> > lost in the noise.  Basically, it _is_ possible to have a "finitrd" for
> > just this situation (at least on 2.4).  You unmount all but root, set up
> > a ramfs, and pivot_root into the ramfs.  You can then unmount root (not
> > just a read-only remount), and properly shutdown LVM/RAID/etc.  Haven't
> > tried it myself, but it should work.
> 
> I keep seeing this pivot_root thing.  Is it actually implemented in 2.4, and
> if so, how does one go about doing it?
according to docs pivot_root syscall is implemented since 2.3.41
i believe pivot_root command is in util-linux 2.10

you use pivot_root command like
mount /dev/vgRoot/lvRoot /Root #mount real root fs
cd /Root 
mkdir -p old_root
pivot_root . old_root #this swaps root and old_root
exec chroot . /sbin/init

btw syscall is 
int pivot_root(const char *new_root, const char *put_old);

L.


-- 
Luca Berra -- bluca at comedia.it
        Communication Media & Services S.r.l.
 /"\
 \ /     ASCII RIBBON CAMPAIGN
  X        AGAINST HTML MAIL
 / \



More information about the linux-lvm mailing list