我可以用它parted
来找出我的图像的偏移量。
sudo parted -s image.img unit B print
Model: (file)
Disk /home/user/image.img: 107374182400B
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End Size Type File system Flags
1 2097152B 107374182399B 107372085248B primary ext4
例如,分区从 开始2097152
。
如何2097152
使用 bash 脚本获得?
我可能可以解析输出,但也许有更合适的方法?