cryptsetup "Cannot wipe header..."

Asked by brad haack

Trying to setup encrypted external harddrive. USB. Maxtor OneTouch II. Using the 'disks' tool in 'All Settings'.
I get this error message:
"Error creating LUKS device: Command-line `cryptsetup luksFormat ""/dev/sdb1""' exited with non-zero exit status 1: Cannot wipe header on device /dev/sdb1"

I get the same error if I use cryptsetup on the command line.

I think it's related to this bug: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1366538

There is talk their of using usb-storage quirks. I can't find much info on how to use that. That seems like a kluge, but if it works I'm game to try it if I knew how.

I haven't been able to use this drive since I switched to 14.04. I posted a question and a bug report which was duped to the one above. I've since changed from 32bit to 64 bit so I thought I'd try it again. It looks like I can format it as NTFS, but I'd like to encrypt it.

xubuntu14.04

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu linux Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Are you going to use the drive in Windows systems or will it only be used in this system and other Linux systems?

Revision history for this message
brad haack (bradhaack-g) said :
#2

The plan is only on my linux system.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Then why use NT at all? It makes no sense

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#4

*NTFS

Revision history for this message
brad haack (bradhaack-g) said :
#5

There's no reason to use ntfs (in fact I don't want to), I just tried it to see if it would work. It seemed to work at first, but there are issues with that.

Revision history for this message
brad haack (bradhaack-g) said :
#6

If I try to format as ext4 I get this err msg:
Error erasing device: Error writing 1048576 bytes to /dev/sdb: Remote I/O error (udisks-error-quark, 0)

And dmesg shows this:
blk_update_request: critical target error, dev sdb, sector 0

Revision history for this message
brad haack (bradhaack-g) said :
#7

I'm going to change the package from cryptsetup to linux (kernel) since it look like that is where the bug is.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#8

I hope you have backups of the data on the drive.

Revision history for this message
brad haack (bradhaack-g) said :
#9

Why was the status changed to answered?

Revision history for this message
Manfred Hampl (m-hampl) said :
#10

As soon as someone adds an answer, the question status changes from "open" to "answered".
Don't confuse the status "answered" with "solved". The "solved" status is set only when the original poster accepts an answers as "this solved my question", which finally closes a question document.

And back to your original question, how to use that quirks modification:

You have to create a file /etc/modprobe.d/maxtor-quirks.conf containing
options usb-storage quirks=0d49:7010:uw
Note, you have to replace 0d49:7010 by the USB ID of your hard disk(s).
You can find it out by issuing the command
lsusb

(Remark, I have no clue if the quirks setting will help with your problem,.)

Revision history for this message
brad haack (bradhaack-g) said :
#11

Thanks, I tried it. formatting to ext4 didn't return an error (using 'Disks' from Setting menu). But when I tried to mount it it just spins. The process udisksd is hung and running 100% cpu (according to top). ps says its defunct.

Revision history for this message
brad haack (bradhaack-g) said :
#12

It appears quirks isn't doing anything.
This is what I have:
dt1:cat /etc/modprobe.d/maxtor-quirks.conf
options usb-storage quirks=0d49:7110:uw

Here: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1366538/comments/34
jmp says
--------------
"I confirm the difference in dmesg, the line
(...) Write cache: enabled, read cache: enabled, doesn't support DPO or FUA

changes to
(...) Assuming drive cache: write through"
-------------

However in my case I still have:
"Write cache: enabled, read cache: enabled, doesn't support DPO or FUA"

dt1:dmesg | tail
[ 8705.408898] usb 1-1.4: new high-speed USB device number 5 using ehci-pci
[ 8705.501965] usb 1-1.4: New USB device found, idVendor=0d49, idProduct=7110
[ 8705.501970] usb 1-1.4: New USB device strings: Mfr=1, Product=3, SerialNumber=2
[ 8705.501981] usb 1-1.4: Product: OneTouch II
[ 8705.501983] usb 1-1.4: Manufacturer: Maxtor
[ 8705.501986] usb 1-1.4: SerialNumber: B2044FVH
[ 8705.502293] usb-storage 1-1.4:1.0: USB Mass Storage device detected
[ 8705.502658] scsi host6: usb-storage 1-1.4:1.0
[ 8706.554288] scsi 6:0:0:0: Direct-Access Maxtor OneTouch II 023g PQ: 0 ANSI: 4
[ 8706.554591] sd 6:0:0:0: Attached scsi generic sg2 type 0
[ 8706.607923] sd 6:0:0:0: [sdb] 195813072 512-byte logical blocks: (100 GB/93.3 GiB)
[ 8706.661645] sd 6:0:0:0: [sdb] Write Protect is off
[ 8706.661652] sd 6:0:0:0: [sdb] Mode Sense: 24 00 00 00
[ 8706.715410] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[ 8706.895757] sdb: unknown partition table
[ 8707.076655] sd 6:0:0:0: [sdb] Attached SCSI disk
[ 8708.893303] blk_update_request: critical target error, dev sdb, sector 0
[ 8708.893322] JBD2: recovery failed
[ 8708.893329] EXT4-fs (sdb): error loading journal

dt1:uname -a
Linux dt1 3.19.0-33-generic #38~14.04.1-Ubuntu SMP Fri Nov 6 18:17:28 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Manfred Hampl (m-hampl) said :
#13

Have you rebooted since adding the quirks config file?

If you do not want to reboot, you might try unloadimg the usb-storage module (sudo rmmod usb-storage) to re-load it with the new settings.

Revision history for this message
brad haack (bradhaack-g) said :
#14

Yes, I've rebooted, a couple of times.

Revision history for this message
brad haack (bradhaack-g) said :
#15

I think I have it working with:

sudo -s
echo 'temporary write through' > /sys/block/sdb/device/scsi_disk/*/cache_type
[note: sudo echo 'temporary write through' > ... . didn't work, I had to use sudo -s]

I'm not sure if the 'temporary' was necessary since when I read back the file it showed 'write through' and temporary was stripped off somehow.

I had help here:
https://bugzilla.kernel.org/show_bug.cgi?id=89511

I'll mark it as solved in a few days if it seems to stick. The developer (A Stern) was not expecting it to be permanent.

Can you help with this problem?

Provide an answer of your own, or ask brad haack for more information if necessary.

To post a message you must log in.