[ltp] Re: Backing up the Predesktop Area?
Marius Gedminas
linux-thinkpad@linux-thinkpad.org
Fri, 21 May 2004 23:56:12 +0300
--Y7xTucakfITjPcLV
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Fri, May 21, 2004 at 04:21:24PM +0200, Georg Sauthoff wrote:
> > My BIOS (Thinkpad T23) does not have an option to disable the HPA, so I
> > have to append hda=3Dstroke to the kernel command line in lilo.conf to
> > access it.
>=20
> hm interesting, I didn't find that parameter documented in linux-2.6.4. W=
ith=20
> which kernel you can use that parameter?
2.4.21 (I should upgrade to 2.4.26 one of these days...)
I do not believe this option is "documented" (grep -i stroke
/usr/src/linux/Documentation yields nothing of interest). I found it
while reading /usr/src/linux/drivers/ide/ide-disk.c (which I found by
grepping for "Host Protected Area"). It is mentioned in a comment
in /usr/src/linux/drivers/ide/ide.c:
/*
* ide_setup() gets called VERY EARLY during initialization,
* to handle kernel "command line" strings beginning with "hdx=3D"
* or "ide". Here is the complete set currently supported:
...
* "hdx=3Dstroke" : runtime version of CONFIG_IDEDISK_STROKE
CONFIG_IDEDISK_STROKE is documented, but it does not mention the HPA,
and only talks about 32GB limits with some BIOSes.
> > > So you have to use '/dev/hda' as 'if' and the 'skip' option.
>=20
> > Can you ask dd to seek to a given position in the input file rather than
> > reading and discarding ~40 gigs of data that is done if you specify
> > 'skip'? AFAIU 'seek' only works on the output file.
>=20
> The 'skip' don't mean, that 'dd' read the skipped stuff. That wouldn't ma=
ke=20
> any sense. 'dd' do of course seeking. If you are curious, just look at th=
e=20
> code.
My mistake. I wonder what I did wrong, because I distinctly remember
waiting for a long time with the disk lamp on while trying to dd a
couple of blocks near the end of the disk. I interrupted it with ^C
after several seconds.
(Looking at dd.c) Maybe I specified the offset in bytes rather than
blocks, the lseek call failed, and dd fell back to reading and
discarding.
(Looking at dmesg full of disk errors, ide reset success and DMA
disabled messages) Oops! Panic!
(Running smartctl self tests and finding no fault with the disk) Perhaps
the hda=3Dstroke option didn't work after all.
# grep -A 4 'Host Protected Area detected.' /var/log/dmesg
hda: Host Protected Area detected.
current capacity is 71969781 sectors (36849 MB)
native capacity is 78140160 sectors (40008 MB)
hda: Host Protected Area disabled.
hda: 78140160 sectors (40008 MB) w/2048KiB Cache, CHS=3D5168/240/63, UDMA=
(100)
# dd if=3D/dev/hda of=3D/dev/null bs=3D512 count=3D1 skip=3D70000000
1+0 records in
1+0 records out
# dd if=3D/dev/hda of=3D/dev/null bs=3D512 count=3D1 skip=3D78000000
dd: reading `/dev/hda': Input/output error
0+0 records in
0+0 records out
0 bytes transferred in 0.800841 seconds (0 bytes/sec)
# dmesg|tail
hda: read_intr: status=3D0x59 { DriveReady SeekComplete DataRequest Error=
}
hda: read_intr: error=3D0x10 { SectorIdNotFound }, LBAsect=3D78000014, se=
ctor=3D78000014
hda: read_intr: status=3D0x59 { DriveReady SeekComplete DataRequest Error=
}
hda: read_intr: error=3D0x10 { SectorIdNotFound }, LBAsect=3D78000014, se=
ctor=3D78000014
hda: read_intr: status=3D0x59 { DriveReady SeekComplete DataRequest Error=
}
hda: read_intr: error=3D0x10 { SectorIdNotFound }, LBAsect=3D78000014, se=
ctor=3D78000014
ide0: reset: success
hda: read_intr: status=3D0x59 { DriveReady SeekComplete DataRequest Error=
}
hda: read_intr: error=3D0x10 { SectorIdNotFound }, LBAsect=3D78000014, se=
ctor=3D78000014
end_request: I/O error, dev 03:00 (hda), sector 78000014
In fact I cannot even access 71969781 sectors
# dd if=3D/dev/hda of=3D/dev/null bs=3D512 count=3D81 skip=3D71969700
dd: reading `/dev/hda': Input/output error
44+0 records in
44+0 records out
22528 bytes transferred in 2.853192 seconds (7896 bytes/sec)
Good thing that my last partition (swap) ends at 4758 * 7741440 / 512 =3D
71940960 sectors then.
Marius Gedminas
--=20
If you are good, you will be assigned all the work. If you are real
good, you will get out of it.
--Y7xTucakfITjPcLV
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFArmzskVdEXeem148RAjqGAJwJccfTehx7/+RnJkbklv2xhUTibACeLfp3
SgBvmTBb+E6HHR3Ju0is3RQ=
=rPQ5
-----END PGP SIGNATURE-----
--Y7xTucakfITjPcLV--