PDA

View Full Version : Image doesn't fit to USB - where did the free space disappear?


japafi
29th March 2010, 02:11 PM
I wanted to participate to printer (and HDD) testing and commented this to the news thread. I have high doubts that people read news to see if additional comments have come, so I'll post here. For give me on double posting, but this hopefully is worth reading.

The dilemma here is: Where did the free space disappear?
Filesystem overhead cannot account for 14 megabytes of lost space.



The Fedora 13 nightly build is just a tiny bit too large to fit into 1 gig USB key.
Though liveusb-creator reports
[creator:544] Verifying filesystem...
[creator:245] freebytes = 994951168
[creator:246] isosize = 980418560
[creator:248] overlaysize = 0

df -k during the install:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb1 971632 217184 754448 23% /media/FEDORA
/dev/loop0 957102 957102 0 100% /tmp/tmpLLEWnm

Both of the above indicate that there is enough space in the USB key.
Ie. Freebytes is more than isosize and /dev/sdb1 bigger than /dev/loop

cp: writing `/media/FEDORA/EFI/boot/vmlinuz0': No space left on device

Second try running liveusb creator comes up with:
Not enough free space on device.
935MB ISO + 0MB overlay > 934MB free space


Where did 14 megabytes of free space disappear?
(971632 x 1 k blocks = 948MB)

scott32746
29th March 2010, 02:55 PM
Hello,
Fedora reserves space you may try
# tune2fs -m0 /dev/sdXX
to remove reserved space

japafi
29th March 2010, 04:24 PM

Forgot to mention that the USB stick is formatted as FAT16.
Disk /dev/sdb: 999 MB, 999555072 bytes
255 heads, 63 sectors/track, 121 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0000ccfc

Device Boot Start End Blocks Id System
/dev/sdb1 1 121 971901 6 FAT16

kyryder
29th March 2010, 04:32 PM
Hello,
You might want to format your usb flash drive to FAT32 since there can be some issues with FAT16 cluster size that could be causing your problem. There is also a setting in Fedora that reserves a % of disk space for root. This setting is adjustable, do a search for more info.

Ky

More info:
Disadvantages of FAT16 are:

The root folder can manage a maximum of 512 entries. The use of long file names can significantly reduce the number of available entries.

FAT16 is limited to 65,536 clusters, but because certain clusters are reserved, it has a practical limit of 65,524. Each cluster is fixed in size relative to the logical drive. If both the maximum number of clusters and their maximum size (32 KB) are reached, the largest drive is limited to 4 GB on Windows 2000. To maintain compatibility with MS-DOS, Windows 95, and Windows 98, a FAT16 volume should not be larger than 2 GB.

The boot sector is not backed up.

There is no built-in file system security or file compression with FAT16.

FAT16 can waste file storage space in larger drives as the size of the cluster increases. The space allocated for storing a file is based on the size of the cluster allocation granularity, not the file size. A 10-KB file stored in a 32-KB cluster wastes 22 KB of disk space.

japafi
29th March 2010, 05:23 PM
To create Fat16 volume that is less than 1 Gigbyte (1024^3 bytes), the cluster size is 16Kb.
statistically half of the cluster size is lost for each file. There is 29 files in the livecd image, so statistically 232Kb lost. Even if we'd be extremely unlucky and for each we have the max overhead where file size wastes clustersize -1 byte per each file, we would lose 463kb. Still long way to go to 14Mb...

Gödel
29th March 2010, 06:23 PM
[creator:544] Verifying filesystem...
[creator:245] freebytes = 994951168
[creator:246] isosize = 980418560
[creator:248] overlaysize = 0


The iso image is only a bit smaller than freebytes, some more space is required for isolinux boot files which is a directory containing ~14mb of files (including the kernel image vmlinuz0).

Having said that, they really shouldn't make the live image so big, isn't it supposed to fit on a cd anyway?

kurtdriver
30th March 2010, 02:11 AM
The iso image is only a bit smaller than freebytes, some more space is required for isolinux boot files which is a directory containing ~14mb of files (including the kernel image vmlinuz0).

Having said that, they really shouldn't make the live image so big, isn't it supposed to fit on a cd anyway?

Not that one. Who uses CDs anymore anyway? DVDs and USB are the way to go.