Red Hat Bugzilla – Bug 155950
mkfs.vat on an LVM volume fails with a drive geometry error
Last modified: 2007-11-30 17:11:04 EST
Description of problem:
When running some file system tests, I noticed that I cannot create a vfat file
system over LVM. It fails with an "unable to get drive geometry" error.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
This is easy to reproduce using loopback devices (but note that it also fails
for block devices):
# dd if=/dev/zero of=/tmp/img.file bs=1M count=128
# losetup /dev/loop0 /tmp/img.file
# pvcreate /dev/loop0
Physical volume "/dev/loop0" successfully created
# vgcreate testvg /dev/loop0
Volume group "testvg" successfully created
# lvcreate -L 100M -n testlv testvg
Logical volume "testlv" created
# mkfs.vfat /dev/testvg/testlv
mkfs.vfat 2.10 (22 Sep 2003)
mkfs.vfat: unable to get drive geometry for '/dev/testvg/testlv'
The above "unable to get drive geometry" error is shown and no file system is
The file system should be created.
I don't expect this to be a common usage scenario, so I'm setting the severity
Created attachment 113770 [details]
Patch that fixes the HDIO_GETGEO problem in mkdosfs
The problem here is that mkdosfs calls the HDIO_GETGEO ioctl, which fails on an
LVM device (ENOTTY - Inappropriate ioctl for device). Upstream dosfstools-2.11
fixes this by using some default geometry values instead. I'm attaching a
similar patch for 2.10.
thx a lot.