FAQ SearchLogin
Tuxera Home
View unanswered posts | View active topics It is currently Fri May 14, 2021 07:04



Post new topic Reply to topic  [ 3 posts ] 
mkntfs kernel freeze with /dev/mapper/* 
Author Message

Joined: Sat Feb 11, 2012 17:38
Posts: 2
Post 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)?


Sat Feb 11, 2012 18:05
Profile
NTFS-3G Lead Developer

Joined: Tue Sep 04, 2007 17:22
Posts: 1286
Post Re: mkntfs kernel freeze with /dev/mapper/*
Hi,

Quote:
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).

Strange. mkntfs is a user-level application, it should not be able to cause the system to freeze, the more as it is just writing a zeroed buffer (and apparently the buffer is correctly allocated).
Did you use some unusual option ?
Quote:
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)?

I think this was done to get the list of bad clusters and mark them as unallocatable... but with current disk sizes, you have to be patient.

Regards

Jean-Pierre


Sun Feb 12, 2012 22:26
Profile

Joined: Sat Feb 11, 2012 17:38
Posts: 2
Post Re: mkntfs kernel freeze with /dev/mapper/*
Thank you for your reply.

Quote:
Strange. mkntfs is a user-level application, it should not be able to cause the system to freeze, the more as it is just writing a zeroed buffer (and apparently the buffer is correctly allocated).
Did you use some unusual option ?


Right, the problem must be in the kernel (or module) code. But what surprises me is that it's triggered only by mkntfs and not dd.

I forgot to mention that I ran all commands as root. There were no additional command arguments other than shown.

As the system freezes, I'm not sure how this could be investigated further.

Quote:
I think this was done to get the list of bad clusters and mark them as unallocatable... but with current disk sizes, you have to be patient.


What I was trying to say is, if modern disks detect and correct bad sectors (which in turn could be assigned to a filesystem cluster) internally, there is no need to check them in software. For instance, mke2fs and others don't do it (and they run very fast by default, because of that).


Mon Feb 13, 2012 04:50
Profile
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 


Who is online

Users browsing this forum: Google [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Original forum style by Vjacheslav Trushkin.