1 |
Hi, |
2 |
|
3 |
I've been looking for simple method to create a simple initramfs to |
4 |
just mount the /usr partition. |
5 |
|
6 |
I've found |
7 |
http://wiki.gentoo.org/wiki/Basic_initramfs_used_to_check_and_mount_/usr |
8 |
|
9 |
which didn't work for me. So, I've modified it, see |
10 |
|
11 |
http://www.igpm.rwth-aachen.de/jarausch/Temp/InitRAMFS/ |
12 |
|
13 |
The last lines of the file 'script_init.sh' are |
14 |
|
15 |
# ====================== end doing stuff |
16 |
|
17 |
mount -o remount,rw /mnt/root ### WHY are |
18 |
cp /proc/mounts /mnt/root/mtab ### these two lines necessary |
19 |
|
20 |
# clean up. The init process will remount proc sys and dev later |
21 |
umount /proc |
22 |
umount /sys |
23 |
# umount /dev # fails, since it's automounted by the kernel |
24 |
|
25 |
# switch to the real root and execute init |
26 |
exec switch_root /mnt/root /sbin/init "$@" |
27 |
|
28 |
|
29 |
I first tried this with the lines marked by '###' removed. |
30 |
This worked on one machine but not on another one. There I got |
31 |
'Remounting root filesystem read/write failed' |
32 |
'mount: / not mounted or bad option' |
33 |
|
34 |
If I replace line 26 of /etc/init.d/root (openrc-0.9.9.3) |
35 |
mount -n -o remount,rw / |
36 |
|
37 |
by |
38 |
|
39 |
mount /dev/root -n -o remount,rw / |
40 |
|
41 |
it works, as well, i.e. without the two marked lines above. |
42 |
The first mount command finds the mount options in /etc/mtab . |
43 |
Why are the marked lines above necessary on only one of two machines |
44 |
(both of which run the same version of openrc)? |
45 |
|
46 |
Many thanks for a hint, |
47 |
Helmut. |