mount挂载

发布时间 2023-04-14 17:05:27作者: 咿呀哒喏

1. 重新挂载remount

适用场景示例:linux破解密码

mount -o remount,rw /sysroot
chroot /sysroot

 

2. 嵌套挂载--bind

适用场景示例:livecd 系统盘挂载调整

unsquashfs -f  /LiveOS/squashfs.img
mount -o loop,rw /LiveOS/sqaushfs-root/LiveOS/rootfs.img /mnt/

mount --bind /dev /mnt/dev
mount --bind /sys /mnt/sys
mount --bind /proc /mnt/proc

chroot /mnt

 

3. nouuid挂载

适用场景示例:挂载系统盘

mount -o nouuid sysbackup.qcow2 /mnt

 

4. 联合挂载 union

涉及到联合文件系统unionfs

适用场景示例:容器多目录挂载到同一目录

$modprobe unionfs
$mount –t unionfs –o dirs=/mnt/cdrom1=ro:/mnt/cdrom2=ro unionfs /mnt/union

 

 

注:个人笔记整理