# partitions and slices



## cbrace (Aug 25, 2011)

Hi all,

I recently did a fresh install of v8.2 on a 2TB drive. During the installation process I created a partition of 25GB, with a section for / and one for /home:

```
/dev/ad4s1a    9.7G    5.3G    3.6G    60%    /
/dev/ad4s1d     14G    2.3G     10G    18%    /home
```

Now I'd like to mount the rest of the drive for misc. storage. I created a new partition, s2, and tried to create slice in it to mount.

I managed to create /dev/ad4s2 but disklabel won't let me create it. It prompts for a mount point. I enter one which exists, but it keeps returing an error message:

```
Error mounting /dev/ad4s2d on /mount/disk8 : No such file or directory
```

What am I missing here?

Thanks


----------



## SirDice (Aug 25, 2011)

You need to label the partition, not the slice.


----------



## wblock@ (Aug 25, 2011)

cbrace said:
			
		

> Now I'd like to mount the rest of the drive for misc. storage. I create  a new slice, s2, and tried to create a label to mount somewhere.



What did you do?



> I managed to create /dev/ad4s2 but disklabel won't let me create label.



What is the error message?



> It prompts for a mount point.



disklabel, which is really bsdlabel(8)?  Or are you trying to use sysinstall?



> I enter one which exists, but it keeps returing an error message:
> 
> ```
> Error mounting /dev/ad4s2d on /mount/disk8 : No such file or directory
> ...



Details, mainly.  What is the output of
`% bsdlabel /dev/ad4s2`


----------



## cbrace (Aug 25, 2011)

Sorry, I am getting my terminology wrong. 

Using sysinstall, first I created a 2nd partition, /dev/ad4s2

Then I tried to create a slice within it, also from within sysinstall. I supplied a mount point, but it kept refusing to accept the value I entered.


```
$ sudo bsdlabel /dev/ad4s2
# /dev/ad4s2:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  c: 3854601072        0    unused        0     0         # "raw" part, don't edit
  d: 3854601072        0    4.2BSD        0     0     0
```

Thanks


----------



## wblock@ (Aug 25, 2011)

cbrace said:
			
		

> Sorry, I am getting my terminology wrong.
> 
> Using sysinstall, first I created a 2nd partition, /dev/ad4s2



Okay, stop right there.  After installing a system, stop using sysinstall.

Seriously.  No, really.

The two programs that do what is needed here are fdisk(8) and bsdlabel(8).

The first step is to create the second slice (MS-DOS partition), normally done with fdisk.  You have succeeded at that with sysinstall.  Be grateful it didn't overwrite /etc/fstab, which it really, really wants to do.



> ```
> $ sudo bsdlabel /dev/ad4s2
> # /dev/ad4s2:
> 8 partitions:
> ...



(Be aware that sudo is not the same as being root.  There are environment differences.  On FreeBSD, use su - to switch to root.)

The first BSD _partition_ should be a, not d.  Ignore the c, you can't use it.

CAUTION: back up the whole drive right now, including the partition table/boot block.  It's easy to kill a working system by changing the bsdlabel.

`# sysctl kern.geom.debugflags=16`
`# bsdlabel -w -B ad4s2`
`# bsdlabel -e ad4s2`

Create an a: _partition_.  This will be in vi(1), if you don't like that, set the EDITOR environment variable to another editor.

```
a: * * 4.2BSD 0 0
c: 3854601072 0 unused 0 0 # "raw" part, don't edit
```
Save that, and the new ad4s2a _partition_ will be available.  Use newfs(8) on it, then it can be mounted.

Reference: Disk Setup On FreeBSD


----------



## SirDice (Aug 26, 2011)

cbrace said:
			
		

> Sorry, I am getting my terminology wrong.
> 
> Using sysinstall, first I created a 2nd partition, /dev/ad4s2
> 
> Then I tried to create a slice within it,


It's the other way around, /dev/ad4s2 is a slice (note the s in there) and you create partitions (a,b, etc) inside it.

And I agree with wblock, stop using sysinstall.


----------



## wblock@ (Aug 26, 2011)

The sysctl in #5 is not necessary.  It was left over from when I was going to include fdisk instructions.


----------



## cbrace (Aug 28, 2011)

Very clear, thank you all. My new slice/partition is now formatted and mounted.


----------

