bug#15633: dd and host protected area

2013-10-16 Thread Peter D.
Hi,

Is it deliberate that dd can not read from, or write to the host protected
area?  Or is it a bug?

It is sensible the the OS does not normally access the HPA, but dd is  not
a normal tool.

Personally I would expect it to be able to read from the HPA and to write
to  it with a suitable flag like, "--yes-I-am-reckless".

Some jurisdictions require that hard drives be blanked before disposal.  Dd
is the obvious tool for that.

I have two 80GB drives in this machine one with HPA, the other without.
Hear is a cut'n'paste from my console...

psd@psd-System-Product-Name:~$
psd@psd-System-Product-Name:~$
psd@psd-System-Product-Name:~$
psd@psd-System-Product-Name:~$ sudo hdparm -N /dev/sdb

/dev/sdb:
 max sectors   = 156299375/156301488, HPA is enabled
psd@psd-System-Product-Name:~$ sudo dd count=1 if=/dev/sdb of=junk
skip=156299376
dd: `/dev/sdb': cannot skip: Invalid argument
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000515987 s, 0.0 kB/s
psd@psd-System-Product-Name:~$ sudo dd count=1 if=/dev/sdb of=junk
skip=156299375
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.000105041 s, 0.0 kB/s
psd@psd-System-Product-Name:~$ sudo hdparm -N /dev/sda

/dev/sda:
 max sectors   = 156301488/156301488, HPA is disabled
psd@psd-System-Product-Name:~$ sudo dd count=1 if=/dev/sda of=junk
skip=156299376
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.0182093 s, 28.1 kB/s
psd@psd-System-Product-Name:~$
psd@psd-System-Product-Name:~$ dd --version
dd (coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later .
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Paul Rubin, David MacKenzie and Stuart Kemp.
psd@psd-System-Product-Name:~$

Thank you.

-- 
Peter D.
Sig goes here...


bug#15633: dd and host protected area

2013-10-16 Thread Pádraig Brady
tag 15633 notabug
close 15633
stop

On 10/16/2013 08:19 AM, Peter D. wrote:
> Hi,
> 
> Is it deliberate that dd can not read from, or write to the host protected
> area?  Or is it a bug?

Deliberate.

dd is a high level tool (the d is for data not disk).
Consequently dd just requests the OS to read/write etc.

> It is sensible the the OS does not normally access the HPA, but dd is  not
> a normal tool.
> 
> Personally I would expect it to be able to read from the HPA and to write
> to  it with a suitable flag like, "--yes-I-am-reckless".
> 
> Some jurisdictions require that hard drives be blanked before disposal.  Dd
> is the obvious tool for that.

shred is more appropriate actually.

I would think a specialized tool (when the OS is allowed access),
or settings in the BIOS to disable this area is more appropriate.

thanks,
Pádraig.





bug#15633: dd and host protected area

2013-10-16 Thread Phillip Susi
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/16/2013 3:19 AM, Peter D. wrote:
> Hi,
> 
> Is it deliberate that dd can not read from, or write to the host
> protected area?  Or is it a bug?

The HPA is a feature of the drive, not the OS or software, so dd has
no idea whether or not there is one and can not "get around" it.  To
unlock the full capacity of the drive you have to send commands to the
drive.  You can have the libata driver do this by setting
libata.ignore_hpa=1.


-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSXvYTAAoJEJrBOlT6nu75nbIH/3fbuqzWpJWKFr9ngYvHcMcB
FkMNDF7Up0JrmaT/7/uXwfGVjUYiGiPdGI9EzmizpKhunfdxc5qkmiM8bD1M2+NW
Nk8dJp/Pc2gw4N++w7IsqQ4U5vPPlqLYRDmYGecC7HOSpRLecHRKXd8V3vMJYvDd
/Tw463Jk/svlZOBGUmtQZnlZnIsjRgcxWqDfMx+4yskjDTVYy7dPjxEa8OEqkBmB
X75N2RN+k7KS/CHtXLMdZ/RwqovSvpbQPuc8WoTgq35GA+IDhFNT/iLExgSooLp+
ijE4JmWsUg867ZxVgYFqKzjARBxYwxxt2sTBk9tFG9AxbZEGldvSGW7PeRgwIjw=
=d4XP
-END PGP SIGNATURE-





bug#15633: dd and host protected area

2013-10-16 Thread SciFi

On 2013/10/16 15:24, Phillip Susi wrote:
> On 10/16/2013 3:19 AM, Peter D. wrote:
>> Hi,
> 
>> Is it deliberate that dd can not read from, or write to the host
>> protected area?  Or is it a bug?
> 
> The HPA is a feature of the drive, not the OS or software, so dd has
> no idea whether or not there is one and can not "get around" it.  To
> unlock the full capacity of the drive you have to send commands to the
> drive.  You can have the libata driver do this by setting
> libata.ignore_hpa=1.

Pardon me for jumping in here, but is there an option in OSX that can do
similarly?  (I know, wrong list & all that jazz, maybe I can get lucky)




signature.asc
Description: OpenPGP digital signature