[klibc] Query regarding initramfs

Hannes Reinecke hare at suse.de
Tue Feb 22 07:21:08 PST 2005


Andreas Jellinghaus wrote:
> Hi Rachita,
> 
> known issue: 
> if you do pivot_root on an initramfs, and you try to unmount
> the /initrd (original initramfs), the linux kernel will crash.
> I think that is a bug, and should be fixed, but as far as I know
> there is no progress.
> 
No. This is _not_ a kernel bug.
You can't unmount the initramfs as this is stored in the kernel rootfs.

The kernel keeps an internal rootfs which is used a virtual mount point 
for all other filesystems.
It has been introduced to simplify the 'mount root' case:
The kernel has to mount the root fs '/', but doesn't actually have a 
filesystem to mount to. In using the virtual rootfs you can just use 
this as a mount point.
It is different with initrd, as this is in fact a separate device (i.e. 
a ramdisk), which itself is mounted below the kernel rootfs and can 
naturally be unmounted.
If fact, you have to if you ever want ot free the memory of the initrd.
Initramfs will be shrunk once you delete a file from there, so you don't 
need to unmount it. Just delete everything on there and you'll be fine.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke			hare at suse.de
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de



More information about the klibc mailing list