Re: switch_root

From: Roy Lanek <roy.lanek_at_gmail.com>
Date: Wed, 16 Oct 2013 20:44:21 +0700

> then I'd probably do something like this [...]

http://lwn.net/Articles/210046/
Embedded Linux: Small Root Filesystems

[...]

Re: the initrd is actually an initramfs
Posted Nov 26, 2006 0:11 UTC (Sun) by landley (guest, #6789) [Link]

The switch_root utility essentially does:

cd newroot
find / -xdev | xargs rm -rf
mount --move . /
chroot . /sbin/init

This frees up the space used by the initramfs by deleting all the files
before switching to the new root device. (With ramfs, deleting the file
frees the memory.)

The reason you can't do this in a shell script is after the "rm -rf" step,
the shell script hasn't got a "mount" command to run anymore...

[...]

***

Cheers,

/Roy
Received on Wed Oct 16 2013 - 13:44:21 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC