how to format an ide hard disc in a usb enclosure

John Nielsen lists at jnielsen.net
Fri Sep 5 14:09:57 UTC 2008


On Friday 05 September 2008, Julian Stacey wrote:
> "Alexander Sack" wrote:
> > On Thu, Sep 4, 2008 at 4:59 PM, Julian Stacey <jhs at berklix.org> wrote:
> > > I know, hence the background, yes I'm fully aware of all repercusions
> > > thanks :-)
> >
> > Then if you understand IDE, understand what a low-level format really
> > is (was), then you know that this is probably NOT what you want to do
> > on your disk and understand it will NOT fix your problem.
> >
> > Other than some special vendor utility or BIOS utility, low-level
> > format doesn't make sense for IDE disks.  There is no command for
> > "format" and trying to reset the geometry like the old days doesn't
> > even apply to modern disks.
> >
> > If you want to try a low-level format tool (for IDE that is probably
> > just writing 0's or 1's to every sector on the disk and letting the
> > hard disk automatically map bad blocks), I would just dd all zero's to
> > it then try to create a filesystem.  If you still get media errors,
> > your disk is foobar or about to be foobar, its cheap and you already
> > stated you don't have any critical data on it so buy a new disk!  :D
> >
> > In fact Seagate offers a Windows too to do exactly this called
> > ZeroFill:
> >
> > http://www.seagate.com/ww/v/index.jsp?vgnextoid=65a8783c970ce010VgnVCM1
> >00000dd04090aRCRD&locale=en-GB
> >
> > Not trying to be too cheeky here, but I think what you are asking
> > doesn't makes sense...at least to me....
>
> I do not run Windows, I run FreeBSD.
> Repeat: How can I low level format this dik under FreeBSD ?

Alexander told you above. It's not a low-level format in the traditional 
(circa early 1990's) sense, but will have the same practical result on 
modern drives: dd all zero's to the disk.

Specifically, something like the following will do the trick. I'm using da0 
since that's what you mentioned in your original e-mail Make sure it's 
still the correct device..
	dd if=/dev/zero of=/dev/da0 bs=1m

The bs flag isn't mandatory but will let it run quite a bit faster than the 
default 512 bytes.

If you then want to put a UFS2 filesystem on it, I'd suggest the following:
	fdisk -I /dev/da0
	bsdlabel -w /dev/da0
	newfs -L myscratchdisk /dev/da0s1a

If you ever expect to want to boot from the drive, add a -B flag to the 
fdisk and bsdlabel commands. Supplying a label to newfs will make the 
filesystem show up by name under /dev/ufs/myscratchdisk (or whatever you 
call it) so you can mount it reliably even if the device node changes.

JN


More information about the freebsd-scsi mailing list