Hi,

I've been looking for simple method to create a simple initramfs to just mount the /usr partition.

I've found
http://wiki.gentoo.org/wiki/Basic_initramfs_used_to_check_and_mount_/usr

which didn't work for me. So, I've modified it, see

http://www.igpm.rwth-aachen.de/jarausch/Temp/InitRAMFS/

The last lines of the file 'script_init.sh' are

# ====================== end doing stuff

mount -o remount,rw /mnt/root     ### WHY are
cp /proc/mounts /mnt/root/mtab    ### these two lines necessary

# clean up. The init process will remount proc sys and dev later
umount /proc
umount /sys
# umount /dev   # fails, since it's automounted by the kernel

# switch to the real root and execute init
exec switch_root /mnt/root /sbin/init "$@"


I first tried this with the lines marked by '###' removed.
This worked on one machine but not on another one. There I got
'Remounting root filesystem read/write failed'
'mount: / not mounted or bad option'

If I replace line 26 of /etc/init.d/root (openrc-0.9.9.3)
mount -n -o remount,rw /

by

mount /dev/root -n -o remount,rw /

it works, as well, i.e. without the two marked lines above.
The first mount command finds the mount options in /etc/mtab .
Why are the marked lines above necessary on only one of two machines
(both of which run the same version of openrc)?

Many thanks for a hint,
Helmut.

Reply via email to