Bug 172369 - mkfs.vfat appears to be compiled without LFS support -> making fat larger than 1GB not possible
mkfs.vfat appears to be compiled without LFS support -> making fat larger tha...
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: dosfstools (Show other bugs)
rawhide
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-03 08:33 EST by Ville Herva
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-11-06 16:19:36 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ville Herva 2005-11-03 08:33:09 EST
From Bugzilla Helper:
User-Agent: Opera/9.0 (Windows NT 5.1; U; en)

Description of problem:
Trying to make a vfat onto a 7GB partition only gives a 1GB fs. 

From the strace it appears LFS support was missing when the package was 
compiled.

Using mkfs.vfat from dosfstools-2.8-15 from RHEL4 yields a complete 7GB fs.

=====================================================================
> strace mkfs.vfat -v -F 32 /dev/loop0
execve("/sbin/mkfs.vfat", ["mkfs.vfat", "-v", "-F", "32", "/dev/loop0"], [/* 51 
vars */]) = 0
brk(0)                                  = 0x8053000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=136437, ...}) = 0
mmap2(NULL, 136437, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7fcb000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0:\306\255"..., 512) = 
512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1462200, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7
fca000
mmap2(0x42ac7000, 1223644, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 
0) = 0x42ac7000
mmap2(0x42bec000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_
DENYWRITE, 3, 0x125) = 0x42bec000
mmap2(0x42bf0000, 7132, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_
ANONYMOUS, -1, 0) = 0x42bf0000
close(3)                                = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7
fc9000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7fc96b0, limit:1048575, seg_
32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, 
useable:1}) = 0
mprotect(0x42bec000, 8192, PROT_READ)   = 0
mprotect(0x42abb000, 4096, PROT_READ)   = 0
munmap(0xb7fcb000, 136437)              = 0
time([1131024223])                      = 1131024223
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 16), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7
fec000
write(1, "mkfs.vfat 2.11 (12 Mar 2005)\n", 29) = 29
open("/dev/loop0", O_RDONLY)            = 3
lseek(3, 0, SEEK_END)                   = -1 EOVERFLOW (Value too large for 
defined data type)
lseek(3, 1, SEEK_SET)                   = 1
read(3, "X", 1)                         = 1
lseek(3, 2, SEEK_SET)                   = 2
read(3, "\220", 1)                      = 1
lseek(3, 4, SEEK_SET)                   = 4
read(3, "k", 1)                         = 1
lseek(3, 8, SEEK_SET)                   = 8
read(3, "f", 1)                         = 1
lseek(3, 16, SEEK_SET)                  = 16
read(3, "\2", 1)                        = 1
lseek(3, 32, SEEK_SET)                  = 32
read(3, "\0", 1)                        = 1
lseek(3, 64, SEEK_SET)                  = 64
read(3, "\0", 1)                        = 1
lseek(3, 128, SEEK_SET)                 = 128
read(3, "o", 1)                         = 1
lseek(3, 256, SEEK_SET)                 = 256
read(3, "\0", 1)                        = 1
lseek(3, 512, SEEK_SET)                 = 512
read(3, "R", 1)                         = 1
lseek(3, 1024, SEEK_SET)                = 1024
read(3, "\0", 1)                        = 1
lseek(3, 2048, SEEK_SET)                = 2048
read(3, "\0", 1)                        = 1
lseek(3, 4096, SEEK_SET)                = 4096
read(3, "\0", 1)                        = 1
lseek(3, 8192, SEEK_SET)                = 8192
read(3, "\0", 1)                        = 1
lseek(3, 16384, SEEK_SET)               = 16384
read(3, "\370", 1)                      = 1
lseek(3, 32768, SEEK_SET)               = 32768
read(3, "\0", 1)                        = 1
lseek(3, 65536, SEEK_SET)               = 65536
read(3, "\0", 1)                        = 1
lseek(3, 131072, SEEK_SET)              = 131072
read(3, "\0", 1)                        = 1
lseek(3, 262144, SEEK_SET)              = 262144
read(3, "\0", 1)                        = 1
lseek(3, 524288, SEEK_SET)              = 524288
read(3, "\0", 1)                        = 1
lseek(3, 1048576, SEEK_SET)             = 1048576
read(3, "\0", 1)                        = 1
lseek(3, 2097152, SEEK_SET)             = 2097152
read(3, "\0", 1)                        = 1
lseek(3, 4194304, SEEK_SET)             = 4194304
read(3, "\0", 1)                        = 1
lseek(3, 8388608, SEEK_SET)             = 8388608
read(3, "\0", 1)                        = 1
lseek(3, 16777216, SEEK_SET)            = 16777216
read(3, "\0", 1)                        = 1
lseek(3, 33554432, SEEK_SET)            = 33554432
read(3, "\0", 1)                        = 1
lseek(3, 67108864, SEEK_SET)            = 67108864
read(3, "\0", 1)                        = 1
lseek(3, 134217728, SEEK_SET)           = 134217728
read(3, "\0", 1)                        = 1
lseek(3, 268435456, SEEK_SET)           = 268435456
read(3, "\0", 1)                        = 1
lseek(3, 536870912, SEEK_SET)           = 536870912
read(3, "\0", 1)                        = 1
lseek(3, 1073741824, SEEK_SET)          = 1073741824
read(3, "\0", 1)                        = 1
lseek(3, 2147483648, SEEK_SET)          = -1 EINVAL (Invalid argument)
lseek(3, 3758096384, SEEK_SET)          = -1 EINVAL (Invalid argument)



Version-Release number of selected component (if applicable):
dosfstools-2.11-1

How reproducible:
Always

Steps to Reproduce:
1. head -c 7000m /dev/zero > image
2. losetup /dev/loop0 image
3. mkfs.vfat -v -F 32 /dev/loop0
4. mount /dev/loop0 /mnt/foo;df -hT /mnt/msdos;umount /mnt/foo
  


Actual Results:  df shows 1Gb file system.


Expected Results:  The fs should be 7GB.


Additional info:
Comment 1 Ville Herva 2005-11-03 13:18:19 EST
fsck.vfat also exhibits this:

Checking we can access the last sector of the filesystem
Seek to -1073512960:Invalid argument

(This made me think the fs was trashed and I wiped it a tried to recreate it - 
which failed due to mkfs.vfat making only 1GB fs... Then I lost the data 
because of a tar bug (https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=
172373). In fact the original FAT fs was only mildly corrupted, fixable by a 
working fsck.vfat (from RHEL4 dosfstools 2.8))
Comment 2 Peter Vrabec 2005-11-04 11:12:25 EST
fixed in dosfstools-2.11-2
Comment 3 Ville Herva 2005-11-04 12:24:22 EST
Thanks.
Comment 4 Ville Herva 2005-11-06 07:31:53 EST
Upgraded to dosfstools-2.11-2 from rawhide.

The test case still fails.

>losetup /dev/loop0 vfat-image.7GB
>fsck.vfat -r -v /dev/loop0 
dosfsck 2.11 (12 Mar 2005)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Checking we can access the last sector of the filesystem
Seek to -1073512960:Invalid argument
>rpm  -qf =fsck.vfat
dosfstools-2.11-2

With fsck.vfat-2.8:

>/tmp/fsck.vfat -r -v /dev/loop0
dosfsck 2.8 (28 Feb 2001)
dosfsck 2.8, 28 Feb 2001, FAT32, LFN
Warning: FAT32 support is still ALPHA.
Boot sector contents:
System ID "MSDOS5.0"
Media byte 0xf8 (hard disk)
       512 bytes per logical sector
      4096 bytes per cluster
        38 reserved sectors
First FAT starts at byte 19456 (sector 38)
         2 FATs, 32 bit entries
   7326208 bytes per FAT (= 14309 sectors)
Root directory start at cluster 2 (arbitrary size)
Data area starts at byte 14671872 (sector 28656)
   1831482 data clusters (3206782976 bytes)
63 sectors/track, 16 heads
  22018752 hidden sectors
  14680512 sectors total
Checking for unused clusters.
Checking free cluster summary.
/dev/loop0: 41894 files, 1049703/1831482 clusters


Please try the test:

head -c 7000m /dev/zero > test-image
losetup /dev/loop0 test-image
mkfs.vfat -F 32 /dev/loop0
fsck.vfat -r -v /dev/loop0



Comment 5 Peter Vrabec 2005-11-06 16:19:36 EST
fixed in dosfstools-2.11-3, hopefully :-)
Comment 6 Ville Herva 2005-11-13 07:42:01 EST
Verified; dosfstools-2.11-3 works.

Note You need to log in before you can comment on or make changes to this bug.