hang with dd when preallocating raw file

Gene Czarcinski gene at czarc.net
Mon Nov 18 08:30:50 UTC 2013


On 11/17/2013 03:23 PM, Chris Murphy wrote:
> So I'm trying to preallocate a VM image file using dd and I'm getting a weird hang regardless of file system (XFS and Btrfs so far). Existing shells, local and ssh, are very sluggish but work. I can't create new shells, either local or ssh, they time out. This is the command I'm using:
>
> dd if=/dev/zero of=fedoraA.img bs=1M count=40000
Two questions here:

1. Have you tried bs=1K count=40000000 to see if it makes a difference?

2. What does filefrag show when you are done (especially on btrfs)?

I do assume that on btrfs you are doing "the right thing" and setting 
chattr +C for the directory.

>
> It takes between 10 seconds and 1.5 minutes for e.g. ls -lsh to return results. And lsattr has been hung for 5 minutes and doesn't return results until dd is done.
>
> free -m reports around 100MB of free memory. There's no obvious runaway process reported by top. So I'm not sure why there's this much of a drag.
>
> How to go about troubleshooting this?

OK, now some addition info ... what is the hardware/software?

I just ran your "problem" with no problem at all.

Hardware: i5-4570S, 16GB memory, twin 250GB SSDs
Software is F20-Beta with BTRFS volume on the SSDs data=raid0, 
metadata=raid1,
/var/lib/libvirt/images as its own subvol,
chattr  +C  /var/lib/libvirt/images

While dd was running, I was able to do ls -lh and lsattr in another window.

Oh, and ended up with 32 extents.

I would try playing with the file size and the block size to see what 
difference it makes (if any).  Right now, I (for one) cannot duplicate 
your problem.

Gene


More information about the test mailing list