Strange disk problems make the system lock up
Scot Hetzel
swhetzel at gmail.com
Thu Feb 17 11:18:59 PST 2005
On Thu, 17 Feb 2005 09:54:01 -0600, Scot Hetzel <swhetzel at gmail.com> wrote:
> On Wed, 16 Feb 2005 21:58:37 +0100, Charles Erik McDonald
> > So, for example:
> >
> > bastion(root):/usr/src#disklabel /dev/ad2
> > disklabel: /dev/ad2: no valid label found
> > bastion(root):/usr/src#disklabel /dev/ad2s1
> > # /dev/ad2s1:
> > 8 partitions:
> > # size offset fstype [fsize bsize bps/cpg]
> > c: 312576642 0 unused 0 0 # "raw" part,
> > don't edit
> > bastion(root):/usr/src#disklabel /dev/ad3
> > disklabel: /dev/ad3: no valid label found
> > bastion(root):/usr/src#disklabel /dev/ad3s1
> > # /dev/ad3s1:
> > 8 partitions:
> > # size offset fstype [fsize bsize bps/cpg]
> > c: 488392002 0 unused 0 0 # "raw" part,
> > don't edit
> > bastion(root):/usr/src#
> >
> you don't have any partitions on those disks.
>
> You need to use disklabel to create an "a" partition.
>
> a: 488392002 0 BSD 0 0 #
> c: 488392002 0 unused 0 0 # "raw" part
>
To add more to my response:
In FreeBSD, the disk is broken down into slices and partitions. A
slice is equivalent to a DOS partition, but can be broken down into 8
partitions (a-h).
The "c" partition is reserved because it is used to define the entire disk.
What you need to do the following to setup /dev/ad3s1:
1. use "disklabel -e /dev/ad3s1" to add a partition (pick one
a,b,d-h). If you want to use the entire slice for the partition, just
copy the "c" partition numbers as:
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
a: 488392002 0 4.2BSD 1024 8192 16
c: 488392002 0 unused 0 0 # "raw" part
NOTE: for "vinium" filesystems, you need an offset of 16
8 partitions:
# size offset fstype [fsize bsize bps/cpg]
c: 488392002 0 unused 0 0 # "raw" part
d: 488392002 16 vinium 1024 8192 16
2. use newfs on /dev/ad3s1a to put a filesystem on it.
newfs /dev/ad3s1a
And that should get you a working partition on your system.
See the man pages on disklabel and newfs for more information.
Scot
More information about the freebsd-stable
mailing list