Description of problem: mkfs-b cannot be used to create vfat or ntfs. Version-Release number of selected component (if applicable): libguestfs-1.3.18 How reproducible: Always Steps to Reproduce: run this script in guestfish, $ guestfish <<EOF sparse test.img 1G run part-disk /dev/vda mbr -mkfs-b vfat 4096 /dev/vda1 -mkfs-b ntfs 4096 /dev/vda1 EOF Actual results: guestfish outputs error with the mkfs-b command, ><fs> mkfs-b vfat 4096 /dev/vda1 libguestfs: error: mkfs_b: vfat: /dev/vda1: mkfs.vfat: Backup boot sector must be a reserved sector ><fs> mkfs-b ntfs 4096 /dev/vda1 libguestfs: error: mkfs_b: ntfs: /dev/vda1: Unknown option '-b'. Cannot understand the number of sectors '/dev/vda1'. Expected results: no error. Additional info: The windows vfat and ntfs file systems have different definition for the 'block size' of unix file systems like ext2/3 -- 'sector size', which (I think) is a same concept as block size. The mkdosfs and mkntfs utilities do not support the -b option (actually mkdosfs do have a -b option which has a completely different meaning). However, the sector sizes of the vfat and ntfs can be set via mkdosfs -S and mkntfs -s I simply tested these commands and they should just work. But it seems that the mkdosfs has limitations about the logical-sector-size and sectors-per-cluster values. I did not investigate very deep in this, should not be too complicated though.
(In reply to comment #0) > Additional info: > The windows vfat and ntfs file systems have different definition for the 'block > size' of unix file systems like ext2/3 -- 'sector size', which (I think) is a > same concept as block size. > > The mkdosfs and mkntfs utilities do not support the -b option (actually mkdosfs > do have a -b option which has a completely different meaning). However, the > sector sizes of the vfat and ntfs can be set via > mkdosfs -S > and > mkntfs -s I think a closer analogy to blocksize is clustersize. It appears that sector size should always be related to the physical sector size of the device (ie. 512 or 4096). We can adjust the clustersize using the appropriate flags, and document this. In the long term it may be better to have explicit DOS and NTFS creation functions that allow all the tunables to be presented.
Patch posted upstream: https://www.redhat.com/archives/libguestfs/2010-June/msg00045.html
(In reply to comment #1) > In the long term it may be better to have explicit > DOS and NTFS creation functions that allow all the > tunables to be presented. Agree this is a solution making better sense.
(In reply to comment #2) > Patch posted upstream: > https://www.redhat.com/archives/libguestfs/2010-June/msg00045.html Tested the patches. Looks good to me.