OpenWRT 查看镜像文件系统 不重启重读分区表 挂载镜像
查看文件系统
opkg update
opkg install parted
parted -m <image> print | tail -n +3 | awk -F ":" '{print $(NF-2)}'
查看已支持的文件系统
cat /proc/filesystems
安装文件系统
opkg install kmod-fs-ntfs
opkg install kmod-fs-xfs
Arch Linux文件系统
parted -m Arch-Linux-x86_64-cloudimg.qcow2 print | tail -n +3 | awk -F ":" '{print $(NF-2)}'
btrfs
Debian 11文件系统
parted -m debian-11-genericcloud-amd64.raw print | tail -n +3 | awk -F ":" '{print $(NF-2)}'
fat16
ext4
Ubuntu 22.04文件系统
parted -m ubuntu-22.04-server-cloudimg-amd64.raw print | tail -n +3 | awk -F ":" '{print $(NF-2)}'
fat32
ext4
CentOS Stream 9文件系统
opkg install kmod-fs-xfs
parted -m CentOS-Stream-GenericCloud-9-20220425.0.x86_64.raw print | tail -n +3 | awk -F ":" '{print $(NF-2)}'
xfs
RHEL 9文件系统
parted -m rhel-baseos-9.0-beta-5-x86_64-kvm.raw print | tail -n +3 | awk -F ":" '{print $(NF-2)}'
fat16
xfs
xfs
MikroTik RouerOS文件系统
parted -m chr-7.3beta37.img print | tail -n +3 | awk -F ":" '{print $(NF-2)}'
ext2
ext3
重读分区表
opkg update
opkg install parted
partprobe /dev/sda
查看分区
lsblk
挂载镜像
opkg update
opkg install losetup
查看空闲loop设备
losetup -f
挂载chr-7.3beta37.img到/mnt
losetup -P loop0 chr-7.3beta37.img /mnt
强制取消挂载
umount -l /mnt
取消img镜像挂载
losetup -d /dev/loop0
