Date: Sat, 12 Dec 2009 20:10:19 +0200 From: Alexander Motin <mav@FreeBSD.org> To: KOT MATPOCKuH <matpockuh@gmail.com> Cc: freebsd-stable@freebsd.org Subject: Re: Trouble with drive size detection - 31MB visible size on 1TB drive. Message-ID: <4B23DC8B.8020807@FreeBSD.org> In-Reply-To: <1260638581.00193503.1260625202@10.7.7.3> References: <1260638581.00193503.1260625202@10.7.7.3>
next in thread | previous in thread | raw e-mail | index | archive | help
KOT MATPOCKuH wrote: > Hi all! > > I have a problem with drive size detection. > After any power cycle my HDD ST31000340NS detected by FreeBSD 7.2 as 31Mb drive. > For example: > Dec 9 20:33:12 green kernel: ad14: 31MB <Seagate ST31000340NS SN06> > at ata7-master SATA300 > Dec 9 20:33:12 green kernel: GEOM: ad14: corrupt or invalid GPT detected. > Dec 9 20:33:12 green kernel: GEOM: ad14: GPT rejected -- may not be > recoverable. > > # atacontrol cap ad14 > [skipped] > cylinders 64 > heads 16 > sectors/track 63 > lba supported 65134 sectors > lba48 supported 65134 sectors > > # smartctl -a /dev/ad14 > [skipped] > User Capacity: 33,348,608 bytes > > I'm tried to reinit/detach/attach drive via atacontrol, but have no result. > But after reboot the system in linux and then back to FreeBSD, I have > correct disk geometry: > ad14: 953869MB <Seagate ST31000340NS SN06> at ata7-master SATA300 > > In linux's dmesg.out I found this messages: > [ 8.984053] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [ 9.120175] ata6.00: HPA unlocked: 65134 -> 1953525168, native 1953525168 > [ 9.120180] ata6.00: ATA-8: ST31000340NS, SN06, max UDMA/133 > [ 9.120183] ata6.00: 1953525168 sectors, multi 16: LBA48 NCQ (depth 31/32) > [ 9.179789] ata6.00: configured for UDMA/133 > [ 9.179851] scsi 5:0:0:0: Direct-Access ATA ST31000340NS > SN06 PQ: 0 ANSI: 5 > [ 9.179960] sd 5:0:0:0: Attached scsi generic sg5 type 0 > [ 9.179992] sd 5:0:0:0: [sdf] 1953525168 512-byte logical blocks: (1.00 TB/93 > 1 GiB) > [ 9.180041] sd 5:0:0:0: [sdf] Write Protect is off > [ 9.180044] sd 5:0:0:0: [sdf] Mode Sense: 00 3a 00 00 > [ 9.180066] sd 5:0:0:0: [sdf] Write cache: enabled, read cache: > enabled, doesn't support DPO or FUA > > What is HPA? Why drive locks HPA? And... Can I unlock HPA from FreeBSD? HPA means "Host Protected Area". It is a method for BIOS or some other infrastructure to reserve some space on disk for own use. May be previously this drive was inserted into some RAID, which protects data on disk in that way. I have doubt that unconditional HPA unlock during boot that seems Linux does is a proper behavior for the OS. IMHO it breaks general idea of HPA. To unlock drive permanently SET MAX ADDRESS ATA command should be used (probably the same as Linux uses) with Volatile bit set, to make it not restore on power cycle. I don't know how to send this command with legacy ata(4), you need some external tool. With new CAM-based ATA probably it can be send via `camcontrol cmd ...`. -- Alexander Motin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B23DC8B.8020807>