Estou assumindo que você está se referindo ao "rootfs". E não, não há como se livrar disso. A documentação do kernel menciona especificamente isso: link
Rootfs is a special instance of ramfs (or tmpfs, if that's enabled), which is always present in 2.6 systems. You can't unmount rootfs for approximately the same reason you can't kill the init process; rather than having special code to check for and handle an empty list, it's smaller and simpler for the kernel to just make sure certain lists can't become empty.
Most systems just mount another filesystem over rootfs and ignore it. The amount of space an empty instance of ramfs takes up is tiny.
Você também não precisa se preocupar com a limpeza de rootfs
. Consulte a documentação do switch_root
: link
WARNING: switch_root removes recursively all files and directories on the current root filesystem.
Além disso, voltando à documentação do kernel, um pouco abaixo da documentação referenciada "rootfs" está outra sinopse que reitera os 2 pontos acima:
When switching another root device, initrd would pivot_root and then umount the ramdisk. But initramfs is rootfs: you can neither pivot_root rootfs, nor unmount it. Instead delete everything out of rootfs to free up the space (find -xdev / -exec rm '{}' ';'), overmount rootfs with the new root (cd /newmount; mount --move . /; chroot .), attach stdin/stdout/stderr to the new /dev/console, and exec the new init.
Since this is a remarkably persnickety process (and involves deleting commands before you can run them), the klibc package introduced a helper program (utils/run_init.c) to do all this for you. Most other packages (such as busybox) have named this command "switch_root".