# fdisk display error



## jronald (Mar 6, 2010)

I installed FreeBSD 8.0 RELEASE from iso, and then compiled the kernel and install it.
Everything seems ok, but when I run fdisk in the console, it can't show the partitions correctly, like this:

```
...
The data for partition 2 is:
<UNUSED>
The data for partition 3 is:
<UNUSED>
The data for partition 4 is:
<UNUSED>
```

I also used sysinstall to view the more partions for more details, it show like this:

```
Part   Mount Size Newfs Part Mount Size Newfs
----   ----- ---- ----  ---- ----  ---- ----
ad0s1a none  xM   *
ad0s1b swap  xM   SWAP
ad0s1d none  xM   *
ad0s1e none  xM   *
ad0s1f none  xM   *
```

Here is the file system config file (/etc/fstab):

```
/dev/ad0s1a /      ufs    rw        1 1
/dev/ad0s1b none   swap   sw        0 0
/dev/ad0s1e /tmp   ufs    rw        2 2
/dev/ad0s1f /usr   ufs    rw        2 2
/dev/ad0s1d /var   ufs    rw        2 2
/dev/acd0   /cdrom cd9660 ro,noauto 0 0
```


Anything wrong?
How to fix it?
Thanks.


----------



## Beastie (Mar 6, 2010)

You don't fix anything, because there's nothing to be fixed.

Your fdisk output probably shows the following first:

```
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
```
Right?

This is a BSD slice (AKA BIOS partition), and this is where all your BSD partitions are stored.

Look at the contents of /etc/fstab. It shows partitions a, b, d, e and f are on the first ATA disk (ad0), first BSD slice/BIOS partition (s1).

So unless you're unable to boot FreeBSD, you have no problem at all.


----------



## jronald (Mar 7, 2010)

Beastie said:
			
		

> You don't fix anything, because there's nothing to be fixed.
> 
> Your fdisk output probably shows the following first:
> 
> ...




All right.
But when installing fdisk is used to make partitions,
how can it lose the partitions' infomation after installing?


----------



## Beastie (Mar 7, 2010)

fdisk is used to make BSD slices (BIOS partitions), not BSD partitions. disklabel is used to create BSD partitions.

Doesn't typing `% fdisk` on a working system return something like in my above post ("The data for partition 1 is ...")?
If it does, then fdisk didn't "lose" anything.
Please explain what you think fdisk is supposed to see that is different from what you already get.


----------



## nhanquy (Mar 7, 2010)

jronald said:
			
		

> All right.
> But when installing fdisk is used to make partitions,
> how can it lose the partitions' infomation after installing?



DOS has 4 partitions (in the MBR). FreeBSD only uses one of those. Inside FreeBSD (partition), it has 5 slices (they are / /var /tmp .....).
The other 3 DOS partions were blank because there is none!
So you don't lose anything.


----------



## Beastie (Mar 7, 2010)

nhanquy said:
			
		

> Inside FreeBSD (partition), it has 5 slices (they are / /var /tmp .....).


It's exactly the opposite.
For the umpteenth time, BIOS partition == BSD slice, and each BSD slice (s1, s2, etc.) can contain 1 or more BSD partition (a, b, d, etc.)


----------



## jronald (Mar 8, 2010)

Right, it shows the first partition correctly,
I'm so careless that I'm confused when I see 3 unknown items.
`bsdlabel` works fine.

Thanks


----------



## SirDice (Mar 8, 2010)

jronald said:
			
		

> Right, it shows the first partition correctly,


No.. It shows the first _slice_ correctly.


----------



## jronald (Mar 9, 2010)

SirDice said:
			
		

> No.. It shows the first _slice_ correctly.



Yes, slice.
But maybe the partition in bsd can still be slice, so it is slice in slice,
and only one concept. Though they have different implementations, it is polymorphism,
right?


----------



## SirDice (Mar 9, 2010)

jronald said:
			
		

> Yes, slice.
> But maybe the partition in bsd can still be slice, so it is slice in slice,


No, there are partitions inside slices. 



> Though they have different implementations, it is polymorphism,
> right?


Close but you do need to get the names correct. A BSD slice is the same thing as a BIOS/DOS partition but it's NOT the same as a BSD partition.


----------



## nhanquy (Mar 10, 2010)

Beastie said:
			
		

> It's exactly the opposite.
> For the umpteenth time, BIOS partition == BSD slice, and each BSD slice (s1, s2, etc.) can contain 1 or more BSD partition (a, b, d, etc.)



No they did not invent the PC to run BSD. They call partition table first; they did not call slice table inside the MBR!


----------



## Beastie (Mar 10, 2010)

This is how they are called in the BSD jargon, by the BSD developers and the entire community. And you don't have to like it.

You can use the words as you want to as long as it's between you... and yourself. This forum is for helping people, and right now you're confusing more than helping.

So whether you like it or not, the BIOS partitions are still getting called (BSD) slices here.


----------



## nhanquy (Mar 11, 2010)

Beastie said:
			
		

> This is how they are called in the BSD jargon, by the BSD developers and the entire community. And you don't have to like it.
> 
> You can use the words as you want to as long as it's between you... and yourself. This forum is for helping people, and right now you're confusing more than helping.
> 
> So whether you like it or not, the BIOS partitions are still getting called (BSD) slices here.



OK. Thanks! I need to learn to what call slices/partitions when I am in BSD world!


----------

