Mkswap fails with fragmented swap files

Bug #222546 reported by Agostino Russo
12
Affects Status Importance Assigned to Milestone
Wubi
Fix Released
Medium
Agostino Russo
util-linux (Ubuntu)
Incomplete
Undecided
Unassigned

Bug Description

It seems that mkswap fails when the swap file is fragmented. A quick workaround is to defragment the swapfile with jkdefrag.

See also https://bugs.launchpad.net/ubuntu/+source/busybox/+bug/206113

Agostino Russo (ago)
description: updated
Agostino Russo (ago)
Changed in wubi:
assignee: nobody → ago
Revision history for this message
mataal (mataal) wrote :

as ago says it can be worked around by defragmenting. what i didwas- http://ubuntuforums.org/showpost.php?p=4802393&postcount=4

Agostino Russo (ago)
Changed in wubi:
importance: Undecided → Medium
status: New → Confirmed
Changed in util-linux:
assignee: nobody → lamont
status: New → Confirmed
Revision history for this message
Agostino Russo (ago) wrote :

LaMont, is it something we can fix on the Linux side? Otherwise I am inclined to add jkdefrag to Wubi (~250K).

Changed in wubi:
milestone: none → 8.04.1
Agostino Russo (ago)
Changed in wubi:
status: Confirmed → Fix Committed
Revision history for this message
LaMont Jones (lamont) wrote :

Is this a swap file, or a swap partition?? In theory, mkswap now handles partial write returns (aka fragmented file).

Revision history for this message
Agostino Russo (ago) wrote :

It is swap on file. From the reports I received, defragmenting did address the issue. It might be that the swap file was extremely fragmented.

Agostino Russo (ago)
Changed in wubi:
status: Fix Committed → In Progress
Revision history for this message
Burre (johan-burell) wrote :

What constitutes as "extremely fragmented"? I got the same problem with 64 fragments on the swap (as verified by contig) on a 80GB, single partition, Dell Inspiron 640m with XP SP3.

While it is not a contiguous file, 64 fragments on a 512MB swap does not seem like a lot. Does it need to be contiguous? I then tried to package the data with "jkdefrag -a 5" to make more room for a contiguous file, but that made so that the Ubuntu boot option did not work (I don't remember the exact error message, but it said that it did not find the wubi loader), I'm guessing this might be due to the packaging setting the loader file beyond the 1024 cylinder?

Will try this again and take more notes from the logs. Maby dig through some code if I find a lead.

Revision history for this message
MadScientist (l-j-collins) wrote :

I also have this problem with the "Failed to create a swap space: The creation of swap space in partition #1 of /host/ubuntu/disks/swap.disk failed" error. It then brings up a screen aksing me to Prepare disk space, which sits there until I quit the installation. I have run jkdefrag with no success and I now cannot delete the ubuntu installation using the uninstaller. I deleted the folder then did the add remove programs which told me it was now uninstalled and would I like it removed from the list. Another jkdefrag then a fresh install, same error. I then did another jkdefrag and got the same error. Thought you should know that jkdefrag is not the solution in all cases. I still have no wubi install.

Revision history for this message
Agostino Russo (ago) wrote :

LaMont, I have noticed a few reports on this, is it possible that there is a regression so that the original patch was reverted?

Revision history for this message
Agostino Russo (ago) wrote :
Revision history for this message
Evan (ev) wrote :

According to LaMont the patch is still there.

Revision history for this message
Agostino Russo (ago) wrote :

Actually recent reports on 9.04 were probably due to virtual disk files being compressed in ntfs (see bug #359716)

Agostino Russo (ago)
Changed in wubi:
status: In Progress → Fix Released
Revision history for this message
Phillip Susi (psusi) wrote :

Please provide the output of hdparm --fibmap on a file where mkswap fails.

Changed in util-linux (Ubuntu):
assignee: LaMont Jones (lamont) → nobody
status: Confirmed → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.