Debian 中 live-helper 创建的 Live USB 映像无法挂载

Debian 中 live-helper 创建的 Live USB 映像无法挂载

我通过 live-helper 制作了自定义 Debian live usb。到目前为止,它运行良好,但是当我向默认安装添加一些额外的软件包时,无法安装输出映像。基本上我这样创建映像:

   # lh_config -b usb-hdd -m http://ftp.cz.debian.org/debian/ --packages "..."
   # lh_build
   # mount -o loop,offset=512 binary.img /mnt

结果是

   mount: you must specify the filesystem type

但由于附加包较少,被挂载。有趣的是这些值:

   # fdisk -ul small.img
   You must set cylinders.
   You can do this from the extra functions menu.

   Disk small.img: 0 MB, 0 bytes
   54 heads, 36 sectors/track, 0 cylinders, total 0 sectors
   Units = sectors of 1 * 512 = 512 bytes
   Disk identifier: 0x0005a3cb

   Device Boot      Start         End      Blocks   Id  System
   small.img1   *           1      276479      138239+  83  Linux
   Partition 1 has different physical/logical endings:
   phys=(17, 53, 36) logical=(142, 11, 36)

从更大的角度来看:

   # fdisk -ul big.img
   You must set cylinders.
   You can do this from the extra functions menu.

   Disk webstep_rescue_disk_usb.img: 0 MB, 0 bytes
   255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
   Units = sectors of 1 * 512 = 512 bytes
   Disk identifier: 0x0002a2ab

   Device Boot      Start         End      Blocks   Id  System
   big.img1   *          63      771119      385528+  83  Linux

那么,问题是什么?图像的末尾在扇区的中间结束还是什么?

我使用了 Debian/Live 信息:http://wiki.debian.org/DebianLive/Howto/USB

安装图像的主要原因是我想要使用 vesa32 自定义 syslinux 菜单和启动画面。

答案1

我已经解决了这个问题。较大映像中的分区从扇区 63 开始,因此正确的挂载命令是

 mount -o loop,offset=32256 binary.img /mnt

偏移参数必须是 bytes_per_sector * start_sector,在本例中是 512 * 63 = 32256。

相关内容