Red Hat Bugzilla – Bug 208
Problems using a swapfile on fat/fat32 partitions.
Last modified: 2008-05-01 11:37:48 EDT
I'd like to report a problem I recently encountered with the
distribution on Intel.
I'd like to know if anyone else has ever experienced the
problem, and if
it can be fixed in any way.
I recently installed Linux on a rather small (ext2 fs)
partition for a
Unix tutorial/demo purposes at work.
There were no place for a swap partition, but my fat/fat32
plenty of space left on them, so I figured I'd use a swap
file on one of
There was a fat32 drive available as /mnt/c and a fat on
/mnt/f. (I believe both of them were mounted as vfat rather
I first tried on the /mnt/f partition. I created a file
(might not have
done it correctly using dd first.), then mkswap on it, and
swapon on it.
Things appeared correct, until I started getting errors
At this point, things started getting bad. I couldn't
access the fat
partition at all. I didn't try to find the exact cause of
and redid the same thing on the fat32 partition (probably
swapfile correctly from the start then).
Same problem happened. After the system tried to use the
guess), the whole fat32 partition was unreadeable.
Worst, I couldn't even boot from the fat32 partition. If
I'd boot from
a diskette, the fat32 partition was accessible fine. I had
with the fat partition, as I've not been able to read
anything from it
since then. From Linux, none of these partitions are now
Closer look at the information on the disk revealed that the
sectors of the partitions appeared to have been totally
Any help in recovering the data/restoring the drive would be
We need to know what parameters you used with the dd command to create
the swap file. It is possible with the wrong paramters that you may
have corrupted your partition table or master boot record. Any other
commands entered after the dd command would also be appreciated.
I was able to successfully do this with the following commands.
# dd if=/dev/zero of=swapfile bs=1024 count=8192
# mkswap swapfile 8192
# swapon swapfile
I was not able to replicate the problem mentioned by the reporter.