Mkswap fails with fragmented swap files

Bug #222546 reported by Agostino Russo on 2008-04-26
Affects Status Importance Assigned to Milestone
Agostino Russo
util-linux (Ubuntu)

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

Agostino Russo (ago) on 2008-04-26
description: updated
Agostino Russo (ago) on 2008-04-26
Changed in wubi:
assignee: nobody → ago
mataal (mataal) wrote :

as ago says it can be worked around by defragmenting. what i didwas-

Agostino Russo (ago) on 2008-04-26
Changed in wubi:
importance: Undecided → Medium
status: New → Confirmed
Changed in util-linux:
assignee: nobody → lamont
status: New → Confirmed
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) on 2008-04-30
Changed in wubi:
status: Confirmed → Fix Committed
LaMont Jones (lamont) wrote :

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

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) on 2008-06-13
Changed in wubi:
status: Fix Committed → In Progress
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.

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.

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?

Evan (ev) wrote :

According to LaMont the patch is still there.

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) on 2009-04-24
Changed in wubi:
status: In Progress → Fix Released
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  Edit
Everyone can see this information.

Other bug subscribers