特殊文件系统挂载总结

#mount #disk,iso,

总结一些特殊文件系统的挂载方式

ISO挂载

#解包
mount -o loop xxx.iso /tmp/ck 

#重新打包参考(两种方式都尝试下)
#方法1:
genisoimage -joliet-long -V x86 -o ck.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v  -iso-level 3 -cache-inodes -T -eltorito-alt-boot -e images/efiboot.img -no-emul-boot ./ck2

#方法2:
mkisofs -o ck.iso -input-charset utf-8 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T -joliet-long ./ck

squashfs挂载

#解压
unsquashfs squashfs.img
#挂载img
cd squashfs-root/xxx && mount rootfs.img /mnt/rootfs 
#重新打包
mksquashfs squashfs-root squashfs.img -comp xz -Xbcj x86 -e boot 

挂载Linux加密磁盘

cryptsetup open /dev/sda1 butterfly
#输入密码后
mount /dev/mapper/butterfly /mnt/

虚拟化挂载磁盘

#带kernel
qemu-system-mipsel -M malta -kernel vmlinux-3.2.0-4-4kc-malta -hda debian_wheezy_mipsel_standard.qcow2 -vga none -append "root=/dev/sda1 console=tty0" -nographic

#其它
qemu-system-x86_64 -net nic,model=rtl8139 -net user,hostfwd=udp::4500-:4500,hostfwd=udp::500-:500,hostfwd=tcp::8888-:8888 -m 512M -smp 1 -hda disk.img -nographic

挂载img

losetup -f -P image.img

# Get the loopback device for the mounted image
LOOP_DEV_PATH=`losetup -a | grep image.img | awk -F: '{print $1;}'`p1

# Mount the EFI partition to a local path (create path first if necessary)
mkdir -p /mnt/image
mount $LOOP_DEV_PATH /mnt/image