format slice
Alejandro Pulver
alejandro at varnet.biz
Sat Mar 12 14:42:52 PST 2005
On Sat, 12 Mar 2005 21:09:33 +0100
"Freek Nossin" <freeknossin at tiscali.nl> wrote:
> Hello, formatting is almost complete...
>
> My new problem is that bsdlabel didn't create a new partition after
> bsdlabel-e ad0s1. Below is an extensive output of some commands, but
> you might want to skip to the last alinea ;).
>
> I used fdisk to create a new slice. I copied the exact format of the
> previous slice (on which the windows installation resided), so I
> didn't have to worry about the "overlapping slices". I got this nice
> output:
>
> pcwin451# fdisk
> ******* Working on device /dev/ad0 *******
> parameters extracted from in-core disklabel are:
> cylinders=39704 heads=16 sectors/track=63 (1008 blks/cyl)
>
> Figures below won't work with BIOS for partitions not in cyl 1
> parameters to be used for BIOS calculations are:
> cylinders=39704 heads=16 sectors/track=63 (1008 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 0 (0000),(unused)
> start 63, size 20820177 (10166 Meg), flag 0
> beg: cyl 0/ head 1/ sector 1;
> end: cyl 174/ head 15/ sector 63
> The data for partition 2 is:
> sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
> start 20820240, size 19201392 (9375 Meg), flag 80 (active)
> beg: cyl 1023/ head 255/ sector 63;
> end: cyl 1023/ head 15/ sector 63
> The data for partition 3 is:
> <UNUSED>
> The data for partition 4 is:
> <UNUSED>
>
> Part 1 is the new slice which I want to use.
> Then I used bsdlabel to create a label on ad0s1 by typing:
>
> #bsdlabel -w ad0s1
>
> And following the handbook, my next command was:
>
> #bsdlabel -e ad0s1
>
> Now I wrote in the text editor (I admit, after 4 tries and a lot of
> reading...):
>
> # /dev/ad0s1:
> 8 partitions:
> # size offset fstype [fsize bsize bps/cpg]
> c: 20820177 0 unused 0 0 # "raw" part,
> don't e: 20820177 0 4.2BSD 2048 16384 32776
>
>
> now I wanted to use newfs to create a file system on ad0s1e, but it
> could not. My problem is illustrated by my ls output:
>
> pcwin451# ls /dev/ad*
> /dev/ad0 /dev/ad0s2 /dev/ad0s2b /dev/ad0s2d
> /dev/ad0s1 /dev/ad0s2a /dev/ad0s2c /dev/ad0s2e
>
> bsdlabel -e didn't create a new partition, although the output of
> bsdlabel ad0s1 is:
>
> pcwin451# disklabel ad0s1
> # /dev/ad0s1:
> 8 partitions:
> # size offset fstype [fsize bsize bps/cpg]
> c: 20820177 0 unused 0 0 # "raw" part,
> don't
> edit
> e: 20820161 16 4.2BSD 2048 16384 32776
>
> How can this be? (and how do I fix it...?)
>
> Thanks for your help already so far
>
> Freek
>
Hello,
In my second disk I have free space between two slices so I tried the
procedure by myself.
When I did a 'bsdlabel -w /dev/adXsY' (without editing them) I ended
with a partition labeled 'a', and it instantly appeared in '/dev/'. Then
I did what you have done ('bsdlabel -e <slice>') and it also appeared in
'/dev'.
I do not know about this, but maybe this helps:
1) Try with only 'bsdlabel -w <slice>'. The partition should appear as
'a'.
2) If the partition does not appear in '/dev/' then you can reinitialize
the ATA channel (0 or 1, I think your disk is in 0) your disk is in,
with 'atacontrol reinit <channel>'. For a list of ATA channels
with the devices do 'atacontrol list'.
***WARNING***: do ***NOT*** 'detach' and 'attach' the channel your
device your running hard disk (that contain the FreeBSD you are
running) is connected to (but you can safely 'reinit' it). A 'detach'
removes the disk and slices/partitions from the kernel and powers down
the devices in that channel, so FreeBSD will stall when it tries to
read/write on its partitions ('/', '/usr', etc.). I could detach and
atach it once (in less than 5 seconds), but the other time it crashed
my machine (I had to rewrite this mail three times, because I was
experimenting with 'atacontrol'). It is more safe to reboot the machine.
Best Regards,
Ale
More information about the freebsd-questions
mailing list