blfs(systemv版本與systemd版本均適用)學習筆記-從主機掛載lfs的方法

運行如下命令,掛載並進入lfs分區便可

su

export LFS=/mnt/lfs

mount -v -t ext4 /dev/sda6 $LFS       
mount -v -t ext4 /dev/sda5 $LFS/boot   
mount -v -t ext4 /dev/sda7 $LFS/home
mount -v --bind /dev $LFS/dev mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620 mount -vt proc proc $LFS/proc mount -vt sysfs sysfs $LFS/sys mount -vt tmpfs tmpfs $LFS/run if [ -h $LFS/dev/shm ]; then mkdir -pv $LFS/$(readlink $LFS/dev/shm) fi chroot "$LFS" /usr/bin/env -i \ HOME=/root TERM="$TERM" \ PS1='(lfs chroot) \u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /bin/bash --login

須要更改的內容:

sda10改成機器爲lfs的根分區bash

sda9改成爲lfs的boot分區spa

sda11改成lfs的home分區code

退出chroot並卸載lfs分區的方法

exit 

umount -v $LFS/dev/pts
umount -v $LFS/dev
umount -v $LFS/run
umount -v $LFS/proc
umount -v $LFS/sys
umount -v $LFS/boot
umount -v $LFS/home umount -v $LFS
相關文章
相關標籤/搜索