Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 May 2009 13:41:37 -0400
From:      Daniel Underwood <djuatdelta@gmail.com>
To:        Matthew Seaman <m.seaman@infracaninophile.co.uk>
Cc:        "freebsd-questions@freebsd.org" <freebsd-questions@freebsd.org>
Subject:   Re: Reformatting external harddrive
Message-ID:  <b6c05a470905121041o8ca1126i99cfcf55f160232e@mail.gmail.com>
In-Reply-To: <4A099D64.9050709@infracaninophile.co.uk>
References:  <b6c05a470905111818ja0ddd76yd5742e4fbfa54bf2@mail.gmail.com> <4A099D64.9050709@infracaninophile.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for all the advice. This evening, when I get home to work, I
will try these suggestions.

I have no idea why there is more than 1 partition on this disk. I must
have inadvertently created multiple partitions when I was struggling
to reformat this disk in linux.  Every time I tried to fdisk (or
perhaps it was mkfs.ext3) on in linux, I got errors about a "bad
superblock" (which I understand somehow relates to the journaling
mechanism of ext3).

Therefore it is my hope that by reverting to the lowest level tools in
FreeBSD to reformat the drive (if that's even the appropriate step to
take) I can reclaim the ~300GB drive for external storage/backups.

On Tue, May 12, 2009 at 12:01 PM, Matthew Seaman
<m.seaman@infracaninophile.co.uk> wrote:
> Daniel Underwood wrote:
>>
>> After unsuccessfully trying to reformat my external harddrive on my
>> linux machine, I'm trying to reformat the disk in FreeBSD. =A0Frankly, I
>> just don't know how to do that. Please help me get the disk back to
>> working order; I don't need to keep any data that is currently on the
>> disk.
>>
>> The command
>>
>> $ /dev/da0
>
> ITYM: fdisk /dev/da0
>
>> gives the following output:
>>
>> ******* Working on device /dev/da0 *******
>> parameters extracted from in-core disklabel are:
>> cylinders=3D38913 heads=3D255 sectors/track=3D63 (16065 blks/cyl)
>>
>> Figures below won't work with BIOS for partitions not in cyl 1
>> parameters to be used for BIOS calculations are:
>> cylinders=3D38913 heads=3D255 sectors/track=3D63 (16065 blks/cyl)
>>
>> Media sector size is 512
>> Warning: BIOS sector numbering starts with sector 1
>> Information from DOS bootblock is:
>> The data for partition 1 is:
>> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
>> =A0 =A0start 63, size 625137282 (305242 Meg), flag 80 (active)
>> =A0 =A0 =A0 =A0beg: cyl 0/ head 1/ sector 1;
>> =A0 =A0 =A0 =A0end: cyl 0/ head 254/ sector 63
>> The data for partition 2 is:
>> <UNUSED>
>> The data for partition 3 is:
>> <UNUSED>
>> The data for partition 4 is:
>> <UNUSED>
>
> This says that you have written a partition table onto the drive that
> indicates the whole disk is being used for FreeBSD. =A0That's a good
> start if your intention is to use the disk dedicated for FreeBSD.
>
> The way the partition naming scheme works you should now have a /dev/da0s=
1
> device file (indicating 'slice 1' or disk 'da0')
>
> In order to make the disk usable with FreeBSD, you need to follow somethi=
ng
> like these steps:
>
> =A0* Use bsdlabel(8) to create BSD partitions on slice1. =A0To write a
> =A0default label:
>
> =A0 =A0 =A0 =A0# bsdlabel -w /dev/da0s1
>
> =A0 =A0Then to edit the default label and define the partitions you want,
>
> =A0 =A0 =A0 =A0# bsdlabel -e da0s1
>
> =A0 =A0Edit mode will pop up an editor with the existing BSD partition
> =A0 =A0table -- that's vi(1) by default but you can override it by settin=
g the
> =A0 =A0EDITOR environment variable.
>
> =A0 =A0If your aim is to use this disk as one big filesystem for storing =
data
> =A0 =A0then creating a 'd' partition covering all the available space wou=
ld be
> =A0 =A0appropriate. =A0After saving the edited partition table you should=
 now have
> =A0 =A0a device file:
>
> =A0 =A0 =A0 =A0/dev/da0s1d
>
> =A0* Use newfs(8) to create a filesystem on the drive. =A0I'd just leave =
it with
> =A0 =A0the default settings unless you know you're going to be using the =
disk
> =A0for unusually large files or unusually many very small files.
>
> =A0 =A0 =A0 =A0newfs /dev/da0s1d
>
> =A0* Mount the new filesystem to make it available to FreeBSD. =A0Add a l=
ine
> like
> =A0 =A0the following to /etc/fstab:
>
> =A0 =A0 =A0 =A0/dev/da0s1d =A0 =A0/data =A0 =A0ufs =A0 =A0rw =A0 =A02 =A0=
 =A02
>
> =A0 =A0 Then create the mount point:
>
> =A0 =A0 =A0 # mkdir -p /data
>
> =A0 =A0 and mount the drive:
>
> =A0 =A0 =A0 # mount /data
>
> =A0 =A0 The drive will be remounted automatically on system reboots and i=
s
> expected
> =A0 =A0 to be permanently present. =A0If you want to have the disk be rem=
ovable,
> then
> =A0 =A0 read all about amd(8) and feel free to ask again here.
>
> =A0 =A0 =A0 =A0Cheers,
>
> =A0 =A0 =A0 =A0Matthew
>
> --
> Dr Matthew J Seaman MA, D.Phil. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 7 Pri=
ory Courtyard
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 Flat 3
> PGP: http://www.infracaninophile.co.uk/pgpkey =A0 =A0 Ramsgate
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 Kent, CT11 9PW
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?b6c05a470905121041o8ca1126i99cfcf55f160232e>