[問題] 開機時根目錄用aufs, move mount
(1):
今天原本的目標是在initramfs時,把root fs用aufs包起來(像live CD)
所以從 kernel cmdline開始:
linux vmlinuz break=mountroot ...
(initramfs) mkdir /root/ro /root/rw
(initramfs) mount -t ext4 -r /dev/sda1 /root/ro
(initramfs) insmod /root/ro/lib/modules/.../kernel/fs/aufs/aufs.ko
(initramfs) mount -t tmpfs /root/rw
(initramfs) mount -t aufs -o br:/root/rw:/root/ro /root
(initramfs) ls /root
/bin .....
這時writeable root看起來弄好了
(initramfs) >/root/root/test
(initramfs) ls /root/root
test
(Ctrl-D)
..........
login:
可是在登入後,/root底下沒有東西,也變成唯讀的了
(2)在平常的shell下
# chroot /bin/ /busybox
chroot: failed to run command `/busybox': No such file or directory
不知到為什麼會這樣,static linked binary也會有dependency?
strace看到的結果是:
chroot("/bin/") = 0
chdir("/") = 0
execve("/busybox", ["/busybox"], [/* 15 vars */]) =
-1 ENOENT (No such file or directory)
又是很怪的問題了,謝謝大家
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.245.32
→
10/19 02:44, , 1F
10/19 02:44, 1F
→
10/19 02:45, , 2F
10/19 02:45, 2F
→
10/19 02:47, , 3F
10/19 02:47, 3F
→
10/19 02:48, , 4F
10/19 02:48, 4F
→
10/19 02:49, , 5F
10/19 02:49, 5F
→
10/19 06:49, , 6F
10/19 06:49, 6F
→
10/19 09:00, , 7F
10/19 09:00, 7F
→
10/19 09:00, , 8F
10/19 09:00, 8F
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):