All of lore.kernel.org
 help / color / mirror / Atom feed
* [dm-crypt] Cannot wipe header on device
@ 2015-12-10 10:18 Luís de Sousa
  2015-12-10 13:35 ` Michael Kjörling
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Luís de Sousa @ 2015-12-10 10:18 UTC (permalink / raw)
  To: dm-crypt

Hi everybody,

I am trying to encrypt an external hard drive on Ubuntu 14.04
following this guide [1]. I have previously ran badblocks, which
returned zero errors; I am also sure the disk is not mounted:

$ findmnt /dev/sdb
$ findmnt /dev/sdb1
$

Whenever I try the initialisation with cryptsetup I get this same error:

$ sudo cryptsetup -y -v luksFormat /dev/sdb1

WARNING!
========
This will overwrite data on /dev/sdb1 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase:
Verify passphrase:
Cannot wipe header on device /dev/sdb1.
Command failed with code 5: Cannot wipe header on device /dev/sdb1.

dmesg is not reporting anything out of the ordinary:

$ dmesg
[ 3208.032228] usb 2-1.4: new high-speed USB device number 7 using ehci-pci
[ 3208.140990] usb 2-1.4: New USB device found, idVendor=059f, idProduct=0651
[ 3208.141001] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[ 3208.141024] usb 2-1.4: Product: LaCie Hard Drive USB
[ 3208.141031] usb 2-1.4: Manufacturer: LaCie
[ 3208.141037] usb 2-1.4: SerialNumber: 10000E000BD8A671
[ 3208.177576] usb-storage 2-1.4:1.0: USB Mass Storage device detected
[ 3208.178112] scsi4 : usb-storage 2-1.4:1.0
[ 3208.178183] usbcore: registered new interface driver usb-storage
[ 3209.176917] scsi 4:0:0:0: Direct-Access     SEAGATE  ST3160812A
  3.AA PQ: 0 ANSI: 2
[ 3209.177561] sd 4:0:0:0: Attached scsi generic sg2 type 0
[ 3209.181342] sd 4:0:0:0: [sdb] 312581808 512-byte logical blocks:
(160 GB/149 GiB)
[ 3209.182337] sd 4:0:0:0: [sdb] Write Protect is off
[ 3209.182348] sd 4:0:0:0: [sdb] Mode Sense: 53 00 00 08
[ 3209.183339] sd 4:0:0:0: [sdb] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[ 3209.201618]  sdb: sdb1
[ 3209.229465] sd 4:0:0:0: [sdb] Attached SCSI disk

In the log a strange message is reporting something with block 0:

$ tail /var/log/syslog
Dec  8 09:18:20 MekanikDestruktiwKommandoh kernel: [ 3698.016311]
end_request: critical target error, dev sdb, sector 0
Dec  8 09:18:28 MekanikDestruktiwKommandoh wpa_supplicant[1188]:
wlan0: CTRL-EVENT-SCAN-STARTED

Any ideas on what may be going wrong here? Thank you,

Luís


[1] http://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Cannot wipe header on device
  2015-12-10 10:18 [dm-crypt] Cannot wipe header on device Luís de Sousa
@ 2015-12-10 13:35 ` Michael Kjörling
  2015-12-10 16:49 ` H McCurdy
  2015-12-10 19:06 ` [dm-crypt] " David Christensen
  2 siblings, 0 replies; 22+ messages in thread
From: Michael Kjörling @ 2015-12-10 13:35 UTC (permalink / raw)
  To: dm-crypt

On 10 Dec 2015 11:18 +0100, from luis.a.de.sousa@gmail.com (Luís de Sousa):
> Cannot wipe header on device /dev/sdb1.
> Command failed with code 5: Cannot wipe header on device /dev/sdb1.

What happens if you try to overwrite the first ten MB or so of the
device using dd?

Something like `dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync`

-- 
Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se
                 “People who think they know everything really annoy
                 those of us who know we don’t.” (Bjarne Stroustrup)

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Cannot wipe header on device
  2015-12-10 10:18 [dm-crypt] Cannot wipe header on device Luís de Sousa
  2015-12-10 13:35 ` Michael Kjörling
@ 2015-12-10 16:49 ` H McCurdy
  2015-12-10 17:24   ` Luís de Sousa
  2015-12-10 19:06 ` [dm-crypt] " David Christensen
  2 siblings, 1 reply; 22+ messages in thread
From: H McCurdy @ 2015-12-10 16:49 UTC (permalink / raw)
  To: Luís de Sousa, dm-crypt

[-- Attachment #1: Type: text/plain, Size: 3105 bytes --]

Hi Luis,

Error 5 is EIO or I/O error.  My first thought was if you are using USB 2.0 because those sometimes have power problems (that would explain an I/O error).  Then I looked at your log and it appears you are using 2.0.  

If I'm right, I suggest disconnecting every USB device that you don't absolutely need and trying again.  (The drive did pass a previous diagnostic test telling us that it was working.)  If that solves the problem, I suggest using a USB 3 drive or using a **powered** USB hub.

Hugh



    On Thursday, December 10, 2015 8:20 AM, Luís de Sousa <luis.a.de.sousa@gmail.com> wrote:
 

 Hi everybody,

I am trying to encrypt an external hard drive on Ubuntu 14.04
following this guide [1]. I have previously ran badblocks, which
returned zero errors; I am also sure the disk is not mounted:

$ findmnt /dev/sdb
$ findmnt /dev/sdb1
$

Whenever I try the initialisation with cryptsetup I get this same error:

$ sudo cryptsetup -y -v luksFormat /dev/sdb1

WARNING!
========
This will overwrite data on /dev/sdb1 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase:
Verify passphrase:
Cannot wipe header on device /dev/sdb1.
Command failed with code 5: Cannot wipe header on device /dev/sdb1.

dmesg is not reporting anything out of the ordinary:

$ dmesg
[ 3208.032228] usb 2-1.4: new high-speed USB device number 7 using ehci-pci
[ 3208.140990] usb 2-1.4: New USB device found, idVendor=059f, idProduct=0651
[ 3208.141001] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[ 3208.141024] usb 2-1.4: Product: LaCie Hard Drive USB
[ 3208.141031] usb 2-1.4: Manufacturer: LaCie
[ 3208.141037] usb 2-1.4: SerialNumber: 10000E000BD8A671
[ 3208.177576] usb-storage 2-1.4:1.0: USB Mass Storage device detected
[ 3208.178112] scsi4 : usb-storage 2-1.4:1.0
[ 3208.178183] usbcore: registered new interface driver usb-storage
[ 3209.176917] scsi 4:0:0:0: Direct-Access    SEAGATE  ST3160812A
  3.AA PQ: 0 ANSI: 2
[ 3209.177561] sd 4:0:0:0: Attached scsi generic sg2 type 0
[ 3209.181342] sd 4:0:0:0: [sdb] 312581808 512-byte logical blocks:
(160 GB/149 GiB)
[ 3209.182337] sd 4:0:0:0: [sdb] Write Protect is off
[ 3209.182348] sd 4:0:0:0: [sdb] Mode Sense: 53 00 00 08
[ 3209.183339] sd 4:0:0:0: [sdb] Write cache: enabled, read cache:
enabled, doesn't support DPO or FUA
[ 3209.201618]  sdb: sdb1
[ 3209.229465] sd 4:0:0:0: [sdb] Attached SCSI disk

In the log a strange message is reporting something with block 0:

$ tail /var/log/syslog
Dec  8 09:18:20 MekanikDestruktiwKommandoh kernel: [ 3698.016311]
end_request: critical target error, dev sdb, sector 0
Dec  8 09:18:28 MekanikDestruktiwKommandoh wpa_supplicant[1188]:
wlan0: CTRL-EVENT-SCAN-STARTED

Any ideas on what may be going wrong here? Thank you,

Luís


[1] http://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/
_______________________________________________
dm-crypt mailing list
dm-crypt@saout.de
http://www.saout.de/mailman/listinfo/dm-crypt


  

[-- Attachment #2: Type: text/html, Size: 4590 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Cannot wipe header on device
  2015-12-10 16:49 ` H McCurdy
@ 2015-12-10 17:24   ` Luís de Sousa
  2015-12-10 17:37     ` H McCurdy
  0 siblings, 1 reply; 22+ messages in thread
From: Luís de Sousa @ 2015-12-10 17:24 UTC (permalink / raw)
  To: H McCurdy; +Cc: dm-crypt

Thank you for the reply.

I connected the external drive directly to my laptop and removed every
other stuff connected through USB. I tried again the initialisation
but I always get this same error.

This external drive is itself powered (with power brick and all). Is
there anything else I could try to identify the cause of this?

Thank you,

Luís


On 10 December 2015 at 17:49, H McCurdy <hmccurdy@yahoo.com> wrote:
> Hi Luis,
>
> Error 5 is EIO or I/O error.  My first thought was if you are using USB 2.0
> because those sometimes have power problems (that would explain an I/O
> error).  Then I looked at your log and it appears you are using 2.0.
>
> If I'm right, I suggest disconnecting every USB device that you don't
> absolutely need and trying again.  (The drive did pass a previous diagnostic
> test telling us that it was working.)  If that solves the problem, I suggest
> using a USB 3 drive or using a **powered** USB hub.
>
> Hugh
>
>
>
> On Thursday, December 10, 2015 8:20 AM, Luís de Sousa
> <luis.a.de.sousa@gmail.com> wrote:
>
>
> Hi everybody,
>
> I am trying to encrypt an external hard drive on Ubuntu 14.04
> following this guide [1]. I have previously ran badblocks, which
> returned zero errors; I am also sure the disk is not mounted:
>
> $ findmnt /dev/sdb
> $ findmnt /dev/sdb1
> $
>
> Whenever I try the initialisation with cryptsetup I get this same error:
>
> $ sudo cryptsetup -y -v luksFormat /dev/sdb1
>
> WARNING!
> ========
> This will overwrite data on /dev/sdb1 irrevocably.
>
> Are you sure? (Type uppercase yes): YES
> Enter passphrase:
> Verify passphrase:
> Cannot wipe header on device /dev/sdb1.
> Command failed with code 5: Cannot wipe header on device /dev/sdb1.
>
> dmesg is not reporting anything out of the ordinary:
>
> $ dmesg
> [ 3208.032228] usb 2-1.4: new high-speed USB device number 7 using ehci-pci
> [ 3208.140990] usb 2-1.4: New USB device found, idVendor=059f,
> idProduct=0651
> [ 3208.141001] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 3208.141024] usb 2-1.4: Product: LaCie Hard Drive USB
> [ 3208.141031] usb 2-1.4: Manufacturer: LaCie
> [ 3208.141037] usb 2-1.4: SerialNumber: 10000E000BD8A671
> [ 3208.177576] usb-storage 2-1.4:1.0: USB Mass Storage device detected
> [ 3208.178112] scsi4 : usb-storage 2-1.4:1.0
> [ 3208.178183] usbcore: registered new interface driver usb-storage
> [ 3209.176917] scsi 4:0:0:0: Direct-Access    SEAGATE  ST3160812A
>   3.AA PQ: 0 ANSI: 2
> [ 3209.177561] sd 4:0:0:0: Attached scsi generic sg2 type 0
> [ 3209.181342] sd 4:0:0:0: [sdb] 312581808 512-byte logical blocks:
> (160 GB/149 GiB)
> [ 3209.182337] sd 4:0:0:0: [sdb] Write Protect is off
> [ 3209.182348] sd 4:0:0:0: [sdb] Mode Sense: 53 00 00 08
> [ 3209.183339] sd 4:0:0:0: [sdb] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> [ 3209.201618]  sdb: sdb1
> [ 3209.229465] sd 4:0:0:0: [sdb] Attached SCSI disk
>
> In the log a strange message is reporting something with block 0:
>
> $ tail /var/log/syslog
> Dec  8 09:18:20 MekanikDestruktiwKommandoh kernel: [ 3698.016311]
> end_request: critical target error, dev sdb, sector 0
> Dec  8 09:18:28 MekanikDestruktiwKommandoh wpa_supplicant[1188]:
> wlan0: CTRL-EVENT-SCAN-STARTED
>
> Any ideas on what may be going wrong here? Thank you,
>
> Luís
>
>
> [1]
> http://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
>
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Cannot wipe header on device
  2015-12-10 17:24   ` Luís de Sousa
@ 2015-12-10 17:37     ` H McCurdy
  2015-12-10 18:25       ` Luís de Sousa
  0 siblings, 1 reply; 22+ messages in thread
From: H McCurdy @ 2015-12-10 17:37 UTC (permalink / raw)
  To: Luís de Sousa; +Cc: dm-crypt

[-- Attachment #1: Type: text/plain, Size: 4361 bytes --]

Hi Luis,
If the drive has its own power, it probably isn't lack of power. I would try Michael's suggestion so that we can get more data points.
An inexpensive thing to try (assuming error code 5 is an errno error, which I think it would be), is a different USB cable.  I broke one of my USB cables just last week.  It looked fine but it isn't fine.  It worked some of the time and didn't work some of the time.  It's in the garbage now after being replaced with a reliable cable.  Even so, please try Michael's test and share the results.

Hugh
 


    On Thursday, December 10, 2015 12:24 PM, Luís de Sousa <luis.a.de.sousa@gmail.com> wrote:
 

 Thank you for the reply.

I connected the external drive directly to my laptop and removed every
other stuff connected through USB. I tried again the initialisation
but I always get this same error.

This external drive is itself powered (with power brick and all). Is
there anything else I could try to identify the cause of this?

Thank you,

Luís


On 10 December 2015 at 17:49, H McCurdy <hmccurdy@yahoo.com> wrote:
> Hi Luis,
>
> Error 5 is EIO or I/O error.  My first thought was if you are using USB 2.0
> because those sometimes have power problems (that would explain an I/O
> error).  Then I looked at your log and it appears you are using 2.0.
>
> If I'm right, I suggest disconnecting every USB device that you don't
> absolutely need and trying again.  (The drive did pass a previous diagnostic
> test telling us that it was working.)  If that solves the problem, I suggest
> using a USB 3 drive or using a **powered** USB hub.
>
> Hugh
>
>
>
> On Thursday, December 10, 2015 8:20 AM, Luís de Sousa
> <luis.a.de.sousa@gmail.com> wrote:
>
>
> Hi everybody,
>
> I am trying to encrypt an external hard drive on Ubuntu 14.04
> following this guide [1]. I have previously ran badblocks, which
> returned zero errors; I am also sure the disk is not mounted:
>
> $ findmnt /dev/sdb
> $ findmnt /dev/sdb1
> $
>
> Whenever I try the initialisation with cryptsetup I get this same error:
>
> $ sudo cryptsetup -y -v luksFormat /dev/sdb1
>
> WARNING!
> ========
> This will overwrite data on /dev/sdb1 irrevocably.
>
> Are you sure? (Type uppercase yes): YES
> Enter passphrase:
> Verify passphrase:
> Cannot wipe header on device /dev/sdb1.
> Command failed with code 5: Cannot wipe header on device /dev/sdb1.
>
> dmesg is not reporting anything out of the ordinary:
>
> $ dmesg
> [ 3208.032228] usb 2-1.4: new high-speed USB device number 7 using ehci-pci
> [ 3208.140990] usb 2-1.4: New USB device found, idVendor=059f,
> idProduct=0651
> [ 3208.141001] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 3208.141024] usb 2-1.4: Product: LaCie Hard Drive USB
> [ 3208.141031] usb 2-1.4: Manufacturer: LaCie
> [ 3208.141037] usb 2-1.4: SerialNumber: 10000E000BD8A671
> [ 3208.177576] usb-storage 2-1.4:1.0: USB Mass Storage device detected
> [ 3208.178112] scsi4 : usb-storage 2-1.4:1.0
> [ 3208.178183] usbcore: registered new interface driver usb-storage
> [ 3209.176917] scsi 4:0:0:0: Direct-Access    SEAGATE  ST3160812A
>  3.AA PQ: 0 ANSI: 2
> [ 3209.177561] sd 4:0:0:0: Attached scsi generic sg2 type 0
> [ 3209.181342] sd 4:0:0:0: [sdb] 312581808 512-byte logical blocks:
> (160 GB/149 GiB)
> [ 3209.182337] sd 4:0:0:0: [sdb] Write Protect is off
> [ 3209.182348] sd 4:0:0:0: [sdb] Mode Sense: 53 00 00 08
> [ 3209.183339] sd 4:0:0:0: [sdb] Write cache: enabled, read cache:
> enabled, doesn't support DPO or FUA
> [ 3209.201618]  sdb: sdb1
> [ 3209.229465] sd 4:0:0:0: [sdb] Attached SCSI disk
>
> In the log a strange message is reporting something with block 0:
>
> $ tail /var/log/syslog
> Dec  8 09:18:20 MekanikDestruktiwKommandoh kernel: [ 3698.016311]
> end_request: critical target error, dev sdb, sector 0
> Dec  8 09:18:28 MekanikDestruktiwKommandoh wpa_supplicant[1188]:
> wlan0: CTRL-EVENT-SCAN-STARTED
>
> Any ideas on what may be going wrong here? Thank you,
>
> Luís
>
>
> [1]
> http://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
>
>

  

[-- Attachment #2: Type: text/html, Size: 7907 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Cannot wipe header on device
  2015-12-10 17:37     ` H McCurdy
@ 2015-12-10 18:25       ` Luís de Sousa
  2015-12-10 19:54         ` H McCurdy
  0 siblings, 1 reply; 22+ messages in thread
From: Luís de Sousa @ 2015-12-10 18:25 UTC (permalink / raw)
  To: H McCurdy; +Cc: dm-crypt

Hi again Hugh,

What is "Michael's test"? I'll be happy to do it if I possibly can.

I do not have an alternative cable, the male plug connecting to the
drive chassis is something I never seen elsewhere, possibly
proprietary.

Thanks once more,

Luís

On 10 December 2015 at 18:37, H McCurdy <hmccurdy@yahoo.com> wrote:
> Hi Luis,
>
> If the drive has its own power, it probably isn't lack of power. I would try
> Michael's suggestion so that we can get more data points.
>
> An inexpensive thing to try (assuming error code 5 is an errno error, which
> I think it would be), is a different USB cable.  I broke one of my USB
> cables just last week.  It looked fine but it isn't fine.  It worked some of
> the time and didn't work some of the time.  It's in the garbage now after
> being replaced with a reliable cable.  Even so, please try Michael's test
> and share the results.
>
> Hugh
>
>
>
> On Thursday, December 10, 2015 12:24 PM, Luís de Sousa
> <luis.a.de.sousa@gmail.com> wrote:
>
>
> Thank you for the reply.
>
> I connected the external drive directly to my laptop and removed every
> other stuff connected through USB. I tried again the initialisation
> but I always get this same error.
>
> This external drive is itself powered (with power brick and all). Is
> there anything else I could try to identify the cause of this?
>
> Thank you,
>
> Luís
>
>
> On 10 December 2015 at 17:49, H McCurdy <hmccurdy@yahoo.com> wrote:
>> Hi Luis,
>>
>> Error 5 is EIO or I/O error.  My first thought was if you are using USB
>> 2.0
>> because those sometimes have power problems (that would explain an I/O
>> error).  Then I looked at your log and it appears you are using 2.0.
>>
>> If I'm right, I suggest disconnecting every USB device that you don't
>> absolutely need and trying again.  (The drive did pass a previous
>> diagnostic
>> test telling us that it was working.)  If that solves the problem, I
>> suggest
>> using a USB 3 drive or using a **powered** USB hub.
>>
>> Hugh
>>
>>
>>
>> On Thursday, December 10, 2015 8:20 AM, Luís de Sousa
>> <luis.a.de.sousa@gmail.com> wrote:
>>
>>
>> Hi everybody,
>>
>> I am trying to encrypt an external hard drive on Ubuntu 14.04
>> following this guide [1]. I have previously ran badblocks, which
>> returned zero errors; I am also sure the disk is not mounted:
>>
>> $ findmnt /dev/sdb
>> $ findmnt /dev/sdb1
>> $
>>
>> Whenever I try the initialisation with cryptsetup I get this same error:
>>
>> $ sudo cryptsetup -y -v luksFormat /dev/sdb1
>>
>> WARNING!
>> ========
>> This will overwrite data on /dev/sdb1 irrevocably.
>>
>> Are you sure? (Type uppercase yes): YES
>> Enter passphrase:
>> Verify passphrase:
>> Cannot wipe header on device /dev/sdb1.
>> Command failed with code 5: Cannot wipe header on device /dev/sdb1.
>>
>> dmesg is not reporting anything out of the ordinary:
>>
>> $ dmesg
>> [ 3208.032228] usb 2-1.4: new high-speed USB device number 7 using
>> ehci-pci
>> [ 3208.140990] usb 2-1.4: New USB device found, idVendor=059f,
>> idProduct=0651
>> [ 3208.141001] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
>> SerialNumber=3
>> [ 3208.141024] usb 2-1.4: Product: LaCie Hard Drive USB
>> [ 3208.141031] usb 2-1.4: Manufacturer: LaCie
>> [ 3208.141037] usb 2-1.4: SerialNumber: 10000E000BD8A671
>> [ 3208.177576] usb-storage 2-1.4:1.0: USB Mass Storage device detected
>> [ 3208.178112] scsi4 : usb-storage 2-1.4:1.0
>> [ 3208.178183] usbcore: registered new interface driver usb-storage
>> [ 3209.176917] scsi 4:0:0:0: Direct-Access    SEAGATE  ST3160812A
>>  3.AA PQ: 0 ANSI: 2
>> [ 3209.177561] sd 4:0:0:0: Attached scsi generic sg2 type 0
>> [ 3209.181342] sd 4:0:0:0: [sdb] 312581808 512-byte logical blocks:
>> (160 GB/149 GiB)
>> [ 3209.182337] sd 4:0:0:0: [sdb] Write Protect is off
>> [ 3209.182348] sd 4:0:0:0: [sdb] Mode Sense: 53 00 00 08
>> [ 3209.183339] sd 4:0:0:0: [sdb] Write cache: enabled, read cache:
>> enabled, doesn't support DPO or FUA
>> [ 3209.201618]  sdb: sdb1
>> [ 3209.229465] sd 4:0:0:0: [sdb] Attached SCSI disk
>>
>> In the log a strange message is reporting something with block 0:
>>
>> $ tail /var/log/syslog
>> Dec  8 09:18:20 MekanikDestruktiwKommandoh kernel: [ 3698.016311]
>> end_request: critical target error, dev sdb, sector 0
>> Dec  8 09:18:28 MekanikDestruktiwKommandoh wpa_supplicant[1188]:
>> wlan0: CTRL-EVENT-SCAN-STARTED
>>
>> Any ideas on what may be going wrong here? Thank you,
>>
>> Luís
>>
>>
>> [1]
>>
>> http://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/
>> _______________________________________________
>> dm-crypt mailing list
>> dm-crypt@saout.de
>> http://www.saout.de/mailman/listinfo/dm-crypt
>>
>>
>
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Cannot wipe header on device
  2015-12-10 10:18 [dm-crypt] Cannot wipe header on device Luís de Sousa
  2015-12-10 13:35 ` Michael Kjörling
  2015-12-10 16:49 ` H McCurdy
@ 2015-12-10 19:06 ` David Christensen
  2 siblings, 0 replies; 22+ messages in thread
From: David Christensen @ 2015-12-10 19:06 UTC (permalink / raw)
  To: dm-crypt

On 12/10/2015 02:18 AM, Luís de Sousa wrote:
> I am trying to encrypt an external hard drive on Ubuntu 14.04 ...
> $ sudo cryptsetup -y -v luksFormat /dev/sdb1

Why "-y"?  It seems to be the default when I do "cryptsetup luksFormat" 
on Debian.


> Cannot wipe header on device /dev/sdb1.
> Command failed with code 5: Cannot wipe header on device /dev/sdb1.
...
> [ 3208.140990] usb 2-1.4: New USB device found, idVendor=059f, idProduct=0651
> [ 3208.141001] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
> SerialNumber=3
> [ 3208.141024] usb 2-1.4: Product: LaCie Hard Drive USB
> [ 3208.141031] usb 2-1.4: Manufacturer: LaCie

I prefer StarTech.


> [ 3209.176917] scsi 4:0:0:0: Direct-Access     SEAGATE  ST3160812A
>    3.AA PQ: 0 ANSI: 2
> [ 3209.177561] sd 4:0:0:0: Attached scsi generic sg2 type 0
> [ 3209.181342] sd 4:0:0:0: [sdb] 312581808 512-byte logical blocks:
> (160 GB/149 GiB)

That's an older PATA drive:

     http://www.seagate.com/support/disc/manuals/ata/100389997c.pdf


> $ tail /var/log/syslog
> Dec  8 09:18:20 MekanikDestruktiwKommandoh kernel: [ 3698.016311]
> end_request: critical target error, dev sdb, sector 0
> Dec  8 09:18:28 MekanikDestruktiwKommandoh wpa_supplicant[1188]:
> wlan0: CTRL-EVENT-SCAN-STARTED

Have you run the Seagate SeaTools Diagostics?  I prefer the DOS version 
-- it's a stand-alone bootable CD:

     http://www.seagate.com/support/downloads/seatools/


If SeaTools finds a problem:

1.  Plug the drive into a different machine and try again.

2.  If the problem persists, open up the USB case, pull the drive, put 
it into a desktop/ server machine with a PATA interface, and run 
SeaTools again.


Otherwise, it's something in Ubuntu.  Try another Linux distribution.


David

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Cannot wipe header on device
  2015-12-10 18:25       ` Luís de Sousa
@ 2015-12-10 19:54         ` H McCurdy
  2015-12-11  4:33           ` Arno Wagner
       [not found]           ` <CAEtdG7sSJQC79cAqCGcMwREH_nTb8NakiXSfCr3+vv3vyo0w+A@mail.gmail.com>
  0 siblings, 2 replies; 22+ messages in thread
From: H McCurdy @ 2015-12-10 19:54 UTC (permalink / raw)
  To: Luís de Sousa; +Cc: dm-crypt

[-- Attachment #1: Type: text/plain, Size: 6077 bytes --]

Luis,
I don't know why you can't see Michael's post but I'll copy/paste it.
The question is what happens if you try to write many zeros to the device.  Does it work or does it throw an error?

dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync

Hugh

Michael Kjörling <michael@kjorling.se>   To  dm-crypt@saout.de           Today at 8:44 AM   On 10 Dec 2015 11:18 +0100, from luis.a.de.sousa@gmail.com (Luís de Sousa):
> Cannot wipe header on device /dev/sdb1.
> Command failed with code 5: Cannot wipe header on device /dev/sdb1.

What happens if you try to overwrite the first ten MB or so of the
device using dd?

Something like `dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync`

-- 
Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se
                “People who think they know everything really annoy
                those of us who know we don’t.” (Bjarne Stroustrup) 


    On Thursday, December 10, 2015 1:25 PM, Luís de Sousa <luis.a.de.sousa@gmail.com> wrote:
 

 Hi again Hugh,

What is "Michael's test"? I'll be happy to do it if I possibly can.

I do not have an alternative cable, the male plug connecting to the
drive chassis is something I never seen elsewhere, possibly
proprietary.

Thanks once more,

Luís

On 10 December 2015 at 18:37, H McCurdy <hmccurdy@yahoo.com> wrote:
> Hi Luis,
>
> If the drive has its own power, it probably isn't lack of power. I would try
> Michael's suggestion so that we can get more data points.
>
> An inexpensive thing to try (assuming error code 5 is an errno error, which
> I think it would be), is a different USB cable.  I broke one of my USB
> cables just last week.  It looked fine but it isn't fine.  It worked some of
> the time and didn't work some of the time.  It's in the garbage now after
> being replaced with a reliable cable.  Even so, please try Michael's test
> and share the results.
>
> Hugh
>
>
>
> On Thursday, December 10, 2015 12:24 PM, Luís de Sousa
> <luis.a.de.sousa@gmail.com> wrote:
>
>
> Thank you for the reply.
>
> I connected the external drive directly to my laptop and removed every
> other stuff connected through USB. I tried again the initialisation
> but I always get this same error.
>
> This external drive is itself powered (with power brick and all). Is
> there anything else I could try to identify the cause of this?
>
> Thank you,
>
> Luís
>
>
> On 10 December 2015 at 17:49, H McCurdy <hmccurdy@yahoo.com> wrote:
>> Hi Luis,
>>
>> Error 5 is EIO or I/O error.  My first thought was if you are using USB
>> 2.0
>> because those sometimes have power problems (that would explain an I/O
>> error).  Then I looked at your log and it appears you are using 2.0.
>>
>> If I'm right, I suggest disconnecting every USB device that you don't
>> absolutely need and trying again.  (The drive did pass a previous
>> diagnostic
>> test telling us that it was working.)  If that solves the problem, I
>> suggest
>> using a USB 3 drive or using a **powered** USB hub.
>>
>> Hugh
>>
>>
>>
>> On Thursday, December 10, 2015 8:20 AM, Luís de Sousa
>> <luis.a.de.sousa@gmail.com> wrote:
>>
>>
>> Hi everybody,
>>
>> I am trying to encrypt an external hard drive on Ubuntu 14.04
>> following this guide [1]. I have previously ran badblocks, which
>> returned zero errors; I am also sure the disk is not mounted:
>>
>> $ findmnt /dev/sdb
>> $ findmnt /dev/sdb1
>> $
>>
>> Whenever I try the initialisation with cryptsetup I get this same error:
>>
>> $ sudo cryptsetup -y -v luksFormat /dev/sdb1
>>
>> WARNING!
>> ========
>> This will overwrite data on /dev/sdb1 irrevocably.
>>
>> Are you sure? (Type uppercase yes): YES
>> Enter passphrase:
>> Verify passphrase:
>> Cannot wipe header on device /dev/sdb1.
>> Command failed with code 5: Cannot wipe header on device /dev/sdb1.
>>
>> dmesg is not reporting anything out of the ordinary:
>>
>> $ dmesg
>> [ 3208.032228] usb 2-1.4: new high-speed USB device number 7 using
>> ehci-pci
>> [ 3208.140990] usb 2-1.4: New USB device found, idVendor=059f,
>> idProduct=0651
>> [ 3208.141001] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
>> SerialNumber=3
>> [ 3208.141024] usb 2-1.4: Product: LaCie Hard Drive USB
>> [ 3208.141031] usb 2-1.4: Manufacturer: LaCie
>> [ 3208.141037] usb 2-1.4: SerialNumber: 10000E000BD8A671
>> [ 3208.177576] usb-storage 2-1.4:1.0: USB Mass Storage device detected
>> [ 3208.178112] scsi4 : usb-storage 2-1.4:1.0
>> [ 3208.178183] usbcore: registered new interface driver usb-storage
>> [ 3209.176917] scsi 4:0:0:0: Direct-Access    SEAGATE  ST3160812A
>>  3.AA PQ: 0 ANSI: 2
>> [ 3209.177561] sd 4:0:0:0: Attached scsi generic sg2 type 0
>> [ 3209.181342] sd 4:0:0:0: [sdb] 312581808 512-byte logical blocks:
>> (160 GB/149 GiB)
>> [ 3209.182337] sd 4:0:0:0: [sdb] Write Protect is off
>> [ 3209.182348] sd 4:0:0:0: [sdb] Mode Sense: 53 00 00 08
>> [ 3209.183339] sd 4:0:0:0: [sdb] Write cache: enabled, read cache:
>> enabled, doesn't support DPO or FUA
>> [ 3209.201618]  sdb: sdb1
>> [ 3209.229465] sd 4:0:0:0: [sdb] Attached SCSI disk
>>
>> In the log a strange message is reporting something with block 0:
>>
>> $ tail /var/log/syslog
>> Dec  8 09:18:20 MekanikDestruktiwKommandoh kernel: [ 3698.016311]
>> end_request: critical target error, dev sdb, sector 0
>> Dec  8 09:18:28 MekanikDestruktiwKommandoh wpa_supplicant[1188]:
>> wlan0: CTRL-EVENT-SCAN-STARTED
>>
>> Any ideas on what may be going wrong here? Thank you,
>>
>> Luís
>>
>>
>> [1]
>>
>> http://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/
>> _______________________________________________
>> dm-crypt mailing list
>> dm-crypt@saout.de
>> http://www.saout.de/mailman/listinfo/dm-crypt
>>
>>
>
>
_______________________________________________
dm-crypt mailing list
dm-crypt@saout.de
http://www.saout.de/mailman/listinfo/dm-crypt


  

[-- Attachment #2: Type: text/html, Size: 14255 bytes --]

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Cannot wipe header on device
  2015-12-10 19:54         ` H McCurdy
@ 2015-12-11  4:33           ` Arno Wagner
       [not found]           ` <CAEtdG7sSJQC79cAqCGcMwREH_nTb8NakiXSfCr3+vv3vyo0w+A@mail.gmail.com>
  1 sibling, 0 replies; 22+ messages in thread
From: Arno Wagner @ 2015-12-11  4:33 UTC (permalink / raw)
  To: dm-crypt

The idea is to test whether it concs out as soon as you 
write to it. That is something that is unfortunately not 
so rare.

Arno
On Thu, Dec 10, 2015 at 20:54:57 CET, H McCurdy wrote:
> Luis,
> I don't know why you can't see Michael's post but I'll copy/paste it.
> The question is what happens if you try to write many zeros to the device.  Does it work or does it throw an error?
> 
> dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync
> 
> Hugh
> 
> Michael Kjörling <michael@kjorling.se>   To  dm-crypt@saout.de           Today at 8:44 AM   On 10 Dec 2015 11:18 +0100, from luis.a.de.sousa@gmail.com (Luís de Sousa):
> > Cannot wipe header on device /dev/sdb1.
> > Command failed with code 5: Cannot wipe header on device /dev/sdb1.
> 
> What happens if you try to overwrite the first ten MB or so of the
> device using dd?
> 
> Something like `dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync`
> 
> -- 
> Michael Kjörling • https://michael.kjorling.se • michael@kjorling.se
>                 “People who think they know everything really annoy
>                 those of us who know we don’t.” (Bjarne Stroustrup) 
> 
> 
>     On Thursday, December 10, 2015 1:25 PM, Luís de Sousa <luis.a.de.sousa@gmail.com> wrote:
>  
> 
>  Hi again Hugh,
> 
> What is "Michael's test"? I'll be happy to do it if I possibly can.
> 
> I do not have an alternative cable, the male plug connecting to the
> drive chassis is something I never seen elsewhere, possibly
> proprietary.
> 
> Thanks once more,
> 
> Luís
> 
> On 10 December 2015 at 18:37, H McCurdy <hmccurdy@yahoo.com> wrote:
> > Hi Luis,
> >
> > If the drive has its own power, it probably isn't lack of power. I would try
> > Michael's suggestion so that we can get more data points.
> >
> > An inexpensive thing to try (assuming error code 5 is an errno error, which
> > I think it would be), is a different USB cable.  I broke one of my USB
> > cables just last week.  It looked fine but it isn't fine.  It worked some of
> > the time and didn't work some of the time.  It's in the garbage now after
> > being replaced with a reliable cable.  Even so, please try Michael's test
> > and share the results.
> >
> > Hugh
> >
> >
> >
> > On Thursday, December 10, 2015 12:24 PM, Luís de Sousa
> > <luis.a.de.sousa@gmail.com> wrote:
> >
> >
> > Thank you for the reply.
> >
> > I connected the external drive directly to my laptop and removed every
> > other stuff connected through USB. I tried again the initialisation
> > but I always get this same error.
> >
> > This external drive is itself powered (with power brick and all). Is
> > there anything else I could try to identify the cause of this?
> >
> > Thank you,
> >
> > Luís
> >
> >
> > On 10 December 2015 at 17:49, H McCurdy <hmccurdy@yahoo.com> wrote:
> >> Hi Luis,
> >>
> >> Error 5 is EIO or I/O error.  My first thought was if you are using USB
> >> 2.0
> >> because those sometimes have power problems (that would explain an I/O
> >> error).  Then I looked at your log and it appears you are using 2.0.
> >>
> >> If I'm right, I suggest disconnecting every USB device that you don't
> >> absolutely need and trying again.  (The drive did pass a previous
> >> diagnostic
> >> test telling us that it was working.)  If that solves the problem, I
> >> suggest
> >> using a USB 3 drive or using a **powered** USB hub.
> >>
> >> Hugh
> >>
> >>
> >>
> >> On Thursday, December 10, 2015 8:20 AM, Luís de Sousa
> >> <luis.a.de.sousa@gmail.com> wrote:
> >>
> >>
> >> Hi everybody,
> >>
> >> I am trying to encrypt an external hard drive on Ubuntu 14.04
> >> following this guide [1]. I have previously ran badblocks, which
> >> returned zero errors; I am also sure the disk is not mounted:
> >>
> >> $ findmnt /dev/sdb
> >> $ findmnt /dev/sdb1
> >> $
> >>
> >> Whenever I try the initialisation with cryptsetup I get this same error:
> >>
> >> $ sudo cryptsetup -y -v luksFormat /dev/sdb1
> >>
> >> WARNING!
> >> ========
> >> This will overwrite data on /dev/sdb1 irrevocably.
> >>
> >> Are you sure? (Type uppercase yes): YES
> >> Enter passphrase:
> >> Verify passphrase:
> >> Cannot wipe header on device /dev/sdb1.
> >> Command failed with code 5: Cannot wipe header on device /dev/sdb1.
> >>
> >> dmesg is not reporting anything out of the ordinary:
> >>
> >> $ dmesg
> >> [ 3208.032228] usb 2-1.4: new high-speed USB device number 7 using
> >> ehci-pci
> >> [ 3208.140990] usb 2-1.4: New USB device found, idVendor=059f,
> >> idProduct=0651
> >> [ 3208.141001] usb 2-1.4: New USB device strings: Mfr=1, Product=2,
> >> SerialNumber=3
> >> [ 3208.141024] usb 2-1.4: Product: LaCie Hard Drive USB
> >> [ 3208.141031] usb 2-1.4: Manufacturer: LaCie
> >> [ 3208.141037] usb 2-1.4: SerialNumber: 10000E000BD8A671
> >> [ 3208.177576] usb-storage 2-1.4:1.0: USB Mass Storage device detected
> >> [ 3208.178112] scsi4 : usb-storage 2-1.4:1.0
> >> [ 3208.178183] usbcore: registered new interface driver usb-storage
> >> [ 3209.176917] scsi 4:0:0:0: Direct-Access    SEAGATE  ST3160812A
> >>  3.AA PQ: 0 ANSI: 2
> >> [ 3209.177561] sd 4:0:0:0: Attached scsi generic sg2 type 0
> >> [ 3209.181342] sd 4:0:0:0: [sdb] 312581808 512-byte logical blocks:
> >> (160 GB/149 GiB)
> >> [ 3209.182337] sd 4:0:0:0: [sdb] Write Protect is off
> >> [ 3209.182348] sd 4:0:0:0: [sdb] Mode Sense: 53 00 00 08
> >> [ 3209.183339] sd 4:0:0:0: [sdb] Write cache: enabled, read cache:
> >> enabled, doesn't support DPO or FUA
> >> [ 3209.201618]  sdb: sdb1
> >> [ 3209.229465] sd 4:0:0:0: [sdb] Attached SCSI disk
> >>
> >> In the log a strange message is reporting something with block 0:
> >>
> >> $ tail /var/log/syslog
> >> Dec  8 09:18:20 MekanikDestruktiwKommandoh kernel: [ 3698.016311]
> >> end_request: critical target error, dev sdb, sector 0
> >> Dec  8 09:18:28 MekanikDestruktiwKommandoh wpa_supplicant[1188]:
> >> wlan0: CTRL-EVENT-SCAN-STARTED
> >>
> >> Any ideas on what may be going wrong here? Thank you,
> >>
> >> Luís
> >>
> >>
> >> [1]
> >>
> >> http://www.cyberciti.biz/hardware/howto-linux-hard-disk-encryption-with-luks-cryptsetup-command/
> >> _______________________________________________
> >> dm-crypt mailing list
> >> dm-crypt@saout.de
> >> http://www.saout.de/mailman/listinfo/dm-crypt
> >>
> >>
> >
> >
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
> 
> 
>   

> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt


-- 
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: arno@wagner.name
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [dm-crypt] Fwd:  Cannot wipe header on device
       [not found]           ` <CAEtdG7sSJQC79cAqCGcMwREH_nTb8NakiXSfCr3+vv3vyo0w+A@mail.gmail.com>
@ 2015-12-11 14:09             ` Luís de Sousa
  2015-12-11 14:34               ` Milan Broz
  0 siblings, 1 reply; 22+ messages in thread
From: Luís de Sousa @ 2015-12-11 14:09 UTC (permalink / raw)
  To: dm-crypt

On 10 December 2015 at 20:54, H McCurdy <hmccurdy@yahoo.com> wrote:
>
> The question is what happens if you try to write many zeros to the device.
> Does it work or does it throw an error?
>
> dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync
>

Hello again,

The dd command goes on ok, but still the cryptsetup initialisation
fails - and with the same error (see below).

I start suspecting this is an issue with the hardware itself. Are
there other tests I could conduct?

Thank you,

Luís


$ sudo dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync
2500+0 records in
2500+0 records out
10240000 bytes (10 MB) copied, 0.579948 s, 17.7 MB/s

$  sudo cryptsetup -y -v luksFormat /dev/sdb1

WARNING!
========
This will overwrite data on /dev/sdb1 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase:
Verify passphrase:
Cannot wipe header on device /dev/sdb1.
Command failed with code 5: Cannot wipe header on device /dev/sdb1.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-11 14:09             ` [dm-crypt] Fwd: " Luís de Sousa
@ 2015-12-11 14:34               ` Milan Broz
  2015-12-11 14:56                 ` Luís de Sousa
  0 siblings, 1 reply; 22+ messages in thread
From: Milan Broz @ 2015-12-11 14:34 UTC (permalink / raw)
  To: Luís de Sousa, dm-crypt

On 12/11/2015 03:09 PM, Luís de Sousa wrote:
> On 10 December 2015 at 20:54, H McCurdy <hmccurdy@yahoo.com> wrote:
>>
>> The question is what happens if you try to write many zeros to the device.
>> Does it work or does it throw an error?
>>
>> dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync
>>
> 
> Hello again,
> 
> The dd command goes on ok, but still the cryptsetup initialisation
> fails - and with the same error (see below).
> 
> I start suspecting this is an issue with the hardware itself. Are
> there other tests I could conduct?
> 
> Thank you,
> 
> Luís
> 
> 
> $ sudo dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync
> 2500+0 records in
> 2500+0 records out
> 10240000 bytes (10 MB) copied, 0.579948 s, 17.7 MB/s

Could you please try to add to dd command: oflag=direct  and try it again?


Milan

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-11 14:34               ` Milan Broz
@ 2015-12-11 14:56                 ` Luís de Sousa
  2015-12-11 15:10                   ` Milan Broz
  2015-12-13 19:52                   ` Milan Broz
  0 siblings, 2 replies; 22+ messages in thread
From: Luís de Sousa @ 2015-12-11 14:56 UTC (permalink / raw)
  To: Milan Broz; +Cc: dm-crypt

On 11 December 2015 at 15:34, Milan Broz <gmazyland@gmail.com> wrote:
>
> Could you please try to add to dd command: oflag=direct  and try it again?
>

Same result (see below). Thanks for helping in any case.

$ sudo dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync oflag=direct
2500+0 records in
2500+0 records out
10240000 bytes (10 MB) copied, 1.59072 s, 6.4 MB/s

$ sudo cryptsetup -y -v luksFormat /dev/sdb1

WARNING!
========
This will overwrite data on /dev/sdb1 irrevocably.

Are you sure? (Type uppercase yes): YES
Enter passphrase:
Verify passphrase:
Cannot wipe header on device /dev/sdb1.
Command failed with code 5: Cannot wipe header on device /dev/sdb1.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-11 14:56                 ` Luís de Sousa
@ 2015-12-11 15:10                   ` Milan Broz
  2015-12-13 19:52                   ` Milan Broz
  1 sibling, 0 replies; 22+ messages in thread
From: Milan Broz @ 2015-12-11 15:10 UTC (permalink / raw)
  To: Luís de Sousa; +Cc: dm-crypt



On 12/11/2015 03:56 PM, Luís de Sousa wrote:
> On 11 December 2015 at 15:34, Milan Broz <gmazyland@gmail.com> wrote:
>>
>> Could you please try to add to dd command: oflag=direct  and try it again?
>>
> 
> Same result (see below). Thanks for helping in any case.
> 
> $ sudo dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync oflag=direct
> 2500+0 records in
> 2500+0 records out
> 10240000 bytes (10 MB) copied, 1.59072 s, 6.4 MB/s
> 
> $ sudo cryptsetup -y -v luksFormat /dev/sdb1
> 
> WARNING!
> ========
> This will overwrite data on /dev/sdb1 irrevocably.
> 
> Are you sure? (Type uppercase yes): YES
> Enter passphrase:
> Verify passphrase:
> Cannot wipe header on device /dev/sdb1.
> Command failed with code 5: Cannot wipe header on device /dev/sdb1.

Interesting... probably some hw issue, anyway

could you please send me (not to the list) strace and that command with
debug information? IOW

cryptsetup -y luksFormat /dev/sdb1 --debug
strace cryptsetup -y luksFormat /dev/sdb1

please do not use valuable password, it will be visible in the second output.

Milan

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-11 14:56                 ` Luís de Sousa
  2015-12-11 15:10                   ` Milan Broz
@ 2015-12-13 19:52                   ` Milan Broz
  2015-12-14  8:44                     ` Luís de Sousa
  1 sibling, 1 reply; 22+ messages in thread
From: Milan Broz @ 2015-12-13 19:52 UTC (permalink / raw)
  To: Luís de Sousa; +Cc: dm-crypt

On 12/11/2015 03:56 PM, Luís de Sousa wrote:
> On 11 December 2015 at 15:34, Milan Broz <gmazyland@gmail.com> wrote:
>>
>> Could you please try to add to dd command: oflag=direct  and try it again?
>>
> 
> Same result (see below). Thanks for helping in any case.
> 
> $ sudo dd if=/dev/zero of=/dev/sdb1 bs=4096 count=2500 conv=sync oflag=direct
> 2500+0 records in
> 2500+0 records out
> 10240000 bytes (10 MB) copied, 1.59072 s, 6.4 MB/s
> 
> $ sudo cryptsetup -y -v luksFormat /dev/sdb1

...

strace shows that it is really IO error reported on write:

open("/dev/sdb1", O_RDWR|O_EXCL|O_SYNC|O_DIRECT) = 6
...
write(6, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4096) = -1 EREMOTEIO (Remote I/O error)


IMHO this operation should print error as well:

dd if=/dev/zero of=/dev/sdb1 bs=4096 count=1 oflag=sync,direct

(note sync is oflag, not conv=...)

Anyway, this is not error in cryptsetup...

Milan

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-13 19:52                   ` Milan Broz
@ 2015-12-14  8:44                     ` Luís de Sousa
  2015-12-14 14:46                       ` Sven Eschenberg
                                         ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Luís de Sousa @ 2015-12-14  8:44 UTC (permalink / raw)
  To: Milan Broz; +Cc: dm-crypt

On 13 December 2015 at 20:52, Milan Broz <gmazyland@gmail.com> wrote:
>
> IMHO this operation should print error as well:
>
> dd if=/dev/zero of=/dev/sdb1 bs=4096 count=1 oflag=sync,direct
>
> (note sync is oflag, not conv=...)
>
> Anyway, this is not error in cryptsetup...
>
> Milan

Hi Milan, thank you for the reply. You can see the output below, there
is an error indeed.

I understand this is not an issue with cryptsetup, but would anyone
have suggestions on how to proceed? Is there any hope of "fixing"
this, e.g. marking this sector as unusable?

Thank you,

Luís

$ sudo dd if=/dev/zero of=/dev/sdb1 bs=4096 count=1 oflag=sync,direct
dd: error writing ‘/dev/sdb1’: Remote I/O error
1+0 records in
0+0 records out
0 bytes (0 B) copied, 0.00142455 s, 0.0 kB/s

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-14  8:44                     ` Luís de Sousa
@ 2015-12-14 14:46                       ` Sven Eschenberg
  2015-12-14 19:53                       ` Robert Nichols
  2015-12-15  8:53                       ` Luís de Sousa
  2 siblings, 0 replies; 22+ messages in thread
From: Sven Eschenberg @ 2015-12-14 14:46 UTC (permalink / raw)
  To: dm-crypt

Hi there,

Personally I am wondering what happens if you add seek=1 to the dd 
command line (namely writing the second 4k block) but keeping sync and 
direct flags.

 >> dd if=/dev/zero of=/dev/sdb1 bs=4096 count=1 oflag=sync,direct seek=1

Regards

-Sven


Am 14.12.2015 um 09:44 schrieb Luís de Sousa:
> On 13 December 2015 at 20:52, Milan Broz <gmazyland@gmail.com> wrote:
>>
>> IMHO this operation should print error as well:
>>
>> dd if=/dev/zero of=/dev/sdb1 bs=4096 count=1 oflag=sync,direct
>>
>> (note sync is oflag, not conv=...)
>>
>> Anyway, this is not error in cryptsetup...
>>
>> Milan
>
> Hi Milan, thank you for the reply. You can see the output below, there
> is an error indeed.
>
> I understand this is not an issue with cryptsetup, but would anyone
> have suggestions on how to proceed? Is there any hope of "fixing"
> this, e.g. marking this sector as unusable?
>
> Thank you,
>
> Luís
>
> $ sudo dd if=/dev/zero of=/dev/sdb1 bs=4096 count=1 oflag=sync,direct
> dd: error writing ‘/dev/sdb1’: Remote I/O error
> 1+0 records in
> 0+0 records out
> 0 bytes (0 B) copied, 0.00142455 s, 0.0 kB/s
> _______________________________________________
> dm-crypt mailing list
> dm-crypt@saout.de
> http://www.saout.de/mailman/listinfo/dm-crypt
>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-14  8:44                     ` Luís de Sousa
  2015-12-14 14:46                       ` Sven Eschenberg
@ 2015-12-14 19:53                       ` Robert Nichols
  2015-12-14 20:39                         ` Arno Wagner
  2015-12-15  8:53                       ` Luís de Sousa
  2 siblings, 1 reply; 22+ messages in thread
From: Robert Nichols @ 2015-12-14 19:53 UTC (permalink / raw)
  To: dm-crypt

On 12/14/2015 02:44 AM, Luís de Sousa wrote:
> I understand this is not an issue with cryptsetup, but would anyone
> have suggestions on how to proceed? Is there any hope of "fixing"
> this, e.g. marking this sector as unusable?
>
> Thank you,
>
> Luís
>
> $ sudo dd if=/dev/zero of=/dev/sdb1 bs=4096 count=1 oflag=sync,direct
> dd: error writing ‘/dev/sdb1’: Remote I/O error
> 1+0 records in
> 0+0 records out
> 0 bytes (0 B) copied, 0.00142455 s, 0.0 kB/s

There should also have been some system error messages logged which
might be informative.

When any reasonably modern (last 20 years, or so) drive shows an
I/O error on a write operation, it generally means that the drive
has run out of spare sectors or has some problem other than media
errors.  Such a drive is long past the time it should have been
replaced.

It would be interesting to see the output from
"smartctl -A /dev/sdb", if the interface supports it. (Not all
USB <=> SATA bridge chips support the necessary commands.)

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-14 19:53                       ` Robert Nichols
@ 2015-12-14 20:39                         ` Arno Wagner
  0 siblings, 0 replies; 22+ messages in thread
From: Arno Wagner @ 2015-12-14 20:39 UTC (permalink / raw)
  To: dm-crypt

On Mon, Dec 14, 2015 at 20:53:59 CET, Robert Nichols wrote:
> On 12/14/2015 02:44 AM, Luís de Sousa wrote:
> >I understand this is not an issue with cryptsetup, but would anyone
> >have suggestions on how to proceed? Is there any hope of "fixing"
> >this, e.g. marking this sector as unusable?
> >
> >Thank you,
> >
> >Luís
> >
> >$ sudo dd if=/dev/zero of=/dev/sdb1 bs=4096 count=1 oflag=sync,direct
> >dd: error writing ‘/dev/sdb1’: Remote I/O error
> >1+0 records in
> >0+0 records out
> >0 bytes (0 B) copied, 0.00142455 s, 0.0 kB/s
> 
> There should also have been some system error messages logged which
> might be informative.
> 
> When any reasonably modern (last 20 years, or so) drive shows an
> I/O error on a write operation, it generally means that the drive
> has run out of spare sectors or has some problem other than media
> errors.  Such a drive is long past the time it should have been
> replaced.

I second that. Errors on reads may be fixable (though it is not
a very good idea to try), errors on write signal imminent death.
 
> It would be interesting to see the output from
> "smartctl -A /dev/sdb", if the interface supports it. (Not all
> USB <=> SATA bridge chips support the necessary commands.)

Especially not very old ones.

Regards,
Arno
-- 
Arno Wagner,     Dr. sc. techn., Dipl. Inform.,    Email: arno@wagner.name
GnuPG: ID: CB5D9718  FP: 12D6 C03B 1B30 33BB 13CF  B774 E35C 5FA1 CB5D 9718
----
A good decision is based on knowledge and not on numbers. -- Plato

If it's in the news, don't worry about it.  The very definition of 
"news" is "something that hardly ever happens." -- Bruce Schneier

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-14  8:44                     ` Luís de Sousa
  2015-12-14 14:46                       ` Sven Eschenberg
  2015-12-14 19:53                       ` Robert Nichols
@ 2015-12-15  8:53                       ` Luís de Sousa
  2015-12-15  9:37                         ` Milan Broz
                                           ` (2 more replies)
  2 siblings, 3 replies; 22+ messages in thread
From: Luís de Sousa @ 2015-12-15  8:53 UTC (permalink / raw)
  To: dm-crypt

Hello again,

I have just consulted the mail list archive and it seems I am only
recieving a restricted number of replies to this thread. You can find
the smartctl output at the end of this message; it essentially says
nothing. Regarding system messages, I am not getting anything beyond
those I already posted here.

Yesterday I ran badblocks again in read-write mode; it took over 8
hours to complete and reported zero errors. The only new thing is the
output from fsck, that is reporting "Bad magic number in super-block"
- see the full output below. I recieve the same error if try one of
the alternate superblocks suggested.

I thank you once more for your help, I really appreciate you keep it
going in this list.

Luís


$ sudo smartctl -A -d scsi /dev/sdb
smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-48-generic] (local build)
Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF READ SMART DATA SECTION ===
Elements in grown defect list: 0

$ sudo fsck /dev/sdb1
fsck from util-linux 2.20.1
e2fsck 1.42.9 (4-Feb-2014)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb1

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem.  If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
    e2fsck -b 8193 <device>
 or
    e2fsck -b 32768 <device>

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-15  8:53                       ` Luís de Sousa
@ 2015-12-15  9:37                         ` Milan Broz
  2015-12-15 17:53                         ` Robert Nichols
  2015-12-16  4:06                         ` David Christensen
  2 siblings, 0 replies; 22+ messages in thread
From: Milan Broz @ 2015-12-15  9:37 UTC (permalink / raw)
  To: Luís de Sousa, dm-crypt



On 12/15/2015 09:53 AM, Luís de Sousa wrote:
> Hello again,
> 
> I have just consulted the mail list archive and it seems I am only
> recieving a restricted number of replies to this thread. You can find
> the smartctl output at the end of this message; it essentially says
> nothing. Regarding system messages, I am not getting anything beyond
> those I already posted here.
> 
> Yesterday I ran badblocks again in read-write mode; it took over 8
> hours to complete and reported zero errors. The only new thing is the
> output from fsck, that is reporting "Bad magic number in super-block"
> - see the full output below. I recieve the same error if try one of
> the alternate superblocks suggested.

I wonder if the problem is O_SYNC flag in that request...

But that would indicate some problem in kernel perhaps.

Milan

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-15  8:53                       ` Luís de Sousa
  2015-12-15  9:37                         ` Milan Broz
@ 2015-12-15 17:53                         ` Robert Nichols
  2015-12-16  4:06                         ` David Christensen
  2 siblings, 0 replies; 22+ messages in thread
From: Robert Nichols @ 2015-12-15 17:53 UTC (permalink / raw)
  To: dm-crypt

On 12/15/2015 02:53 AM, Luís de Sousa wrote:
> $ sudo smartctl -A -d scsi /dev/sdb
> smartctl 6.2 2013-07-26 r3841 [x86_64-linux-3.13.0-48-generic] (local build)
> Copyright (C) 2002-13, Bruce Allen, Christian Franke, www.smartmontools.org
>
> === START OF READ SMART DATA SECTION ===
> Elements in grown defect list: 0
>

Why the "-d scsi"?  Did "smartctl -A" not work at all without that?

-- 
Bob Nichols     "NOSPAM" is really part of my email address.
                 Do NOT delete it.

^ permalink raw reply	[flat|nested] 22+ messages in thread

* Re: [dm-crypt] Fwd: Cannot wipe header on device
  2015-12-15  8:53                       ` Luís de Sousa
  2015-12-15  9:37                         ` Milan Broz
  2015-12-15 17:53                         ` Robert Nichols
@ 2015-12-16  4:06                         ` David Christensen
  2 siblings, 0 replies; 22+ messages in thread
From: David Christensen @ 2015-12-16  4:06 UTC (permalink / raw)
  To: dm-crypt

On 12/15/2015 12:53 AM, Luís de Sousa wrote:
> I have just consulted the mail list archive and it seems I am only
> recieving a restricted number of replies to this thread.

Have you tried the Seagate SeaTools diagnostics?

     http://www.saout.de/pipermail/dm-crypt/2015-December/004883.html


David

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-12-16  4:09 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-10 10:18 [dm-crypt] Cannot wipe header on device Luís de Sousa
2015-12-10 13:35 ` Michael Kjörling
2015-12-10 16:49 ` H McCurdy
2015-12-10 17:24   ` Luís de Sousa
2015-12-10 17:37     ` H McCurdy
2015-12-10 18:25       ` Luís de Sousa
2015-12-10 19:54         ` H McCurdy
2015-12-11  4:33           ` Arno Wagner
     [not found]           ` <CAEtdG7sSJQC79cAqCGcMwREH_nTb8NakiXSfCr3+vv3vyo0w+A@mail.gmail.com>
2015-12-11 14:09             ` [dm-crypt] Fwd: " Luís de Sousa
2015-12-11 14:34               ` Milan Broz
2015-12-11 14:56                 ` Luís de Sousa
2015-12-11 15:10                   ` Milan Broz
2015-12-13 19:52                   ` Milan Broz
2015-12-14  8:44                     ` Luís de Sousa
2015-12-14 14:46                       ` Sven Eschenberg
2015-12-14 19:53                       ` Robert Nichols
2015-12-14 20:39                         ` Arno Wagner
2015-12-15  8:53                       ` Luís de Sousa
2015-12-15  9:37                         ` Milan Broz
2015-12-15 17:53                         ` Robert Nichols
2015-12-16  4:06                         ` David Christensen
2015-12-10 19:06 ` [dm-crypt] " David Christensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.