如何查看磁盘映像 FAT32 分区上的剩余空间?

如何查看磁盘映像 FAT32 分区上的剩余空间?

鉴于当前 Debian 安装程序高清媒体启动映像文件,如何找出包含的 FAT32 格式分区中剩余多少可用空间?

这是我到目前为止所拥有的:

$ curl -fsSLO https://deb.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/boot.img.gz

$ gzip -fdk boot.img.gz

$ stat boot.img
  File: boot.img
  Size: 999997440   Blocks: 1953120    IO Block: 4096   regular file
Device: fd01h/64769d    Inode: 7998443     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/    neil)   Gid: ( 1000/    neil)
Access: 2020-07-23 16:42:25.173516535 +0000
Modify: 2020-07-23 16:41:58.025469623 +0000
Change: 2020-07-23 16:42:35.437534306 +0000
 Birth: -

$ file boot.img
boot.img: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "SYSLINUX", sectors/cluster 8, Media descriptor 0xf8, sectors/track 63, heads 255, sectors 1953120 (volumes > 32 MB), FAT (32 bit), sectors/FAT 1904, serial number 0xdeb00001, label: "Debian Inst"

$ fdisk -l boot.img
Disk boot.img: 953.7 MiB, 999997440 bytes, 1953120 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x20ac7dda

Device     Boot      Start        End    Sectors   Size Id Type
boot.img1       3224498923 3657370039  432871117 206.4G  7 HPFS/NTFS/exFAT
boot.img2       3272020941 5225480974 1953460034 931.5G 16 Hidden FAT16
boot.img3                0          0          0     0B 6f unknown
boot.img4         50200576  974536369  924335794 440.8G  0 Empty

Partition table entries are not in disk order.

$ fatresize -i boot.img
fatresize 1.0.2 (10/15/17)
FAT: fat32
Size: 999997440
Min size: 536870912
Max size: 999997440

上述数字中有一个是我想要的吗?

答案1

使用mdir(来自mtools):

$ mdir -i boot.img ::
...
g2ldr    mbr      8192 2020-05-04  19:14
WIN32-~1 INI       178 2020-05-04  19:14  win32-loader.ini
       43 files          76 373 022 bytes
                        921 333 760 bytes free

正如您所看到的,您拥有的数字都不匹配剩余的可用空间。

相关内容