
mkntfs kernel freeze with /dev/mapper/*
I'm using Ubuntu 11.10 on amd64, with ntfs-3g 2011.4.12AR.4.
At first I thought there was a problem with TrueCrypt as the system froze when I tried to create a filesystem inside a container. It happened when filling the device with zeros, at about 1% or 2% (the file had 50GB in this case, but didn't seem relevant).
Code:
$ mkntfs /dev/mapper/truecrypt1
<system froze in the "filling with zeros" phase>
Then I tried with dm-crypt/LUKS, and after setting up a file-backed disk, and the same occurred with mkntfs.
Code:
<losetup and cryptsetup luks...>
$ mkntfs /dev/mapper/crypt
<system froze in the "filling with zeros" phase>
When using mke2fs it worked and mounted fine in both previous cases. I believe the problem is related to /dev/mapper/* devices as it worked fine with /dev/loopX only. And I think it has to do with mkntfs because "dd if=/dev/zero of=/dev/mapper/truecrypt1" works as well. Finally, mkntfs succeeds if using a "quick format" (-f). To summarize:
Code:
$ mke2fs /dev/mapper/truecrypt1
<works>
$ mkntfs /dev/loop0
<works>
$ dd if=/dev/zero of=/dev/mapper/truecrypt1
<works>
$ mkntfs /dev/mapper/truecrypt1
<system freezes in the "filling with zeros" phase>
$ mkntfs -f /dev/mapper/truecrypt1
<works>
After the last command, the filesystem can be mounted and used normally. So it isn't so serious, but I wanted to report it as it crashes the system with default settings.
BTW is there a reason to keep zeroing on by default (AFAIK modern disks manage bad sectors internally and it is useless when using a file instead of a device)?