Re: gpart: can not add MBR partitions with "gpart add -t, mbr"

From: Genre Roger <genre.roger_at_orange.fr>
Date: Fri, 21 Jun 2013 17:08:52 +0200
Hi,

When I refer to gpart(8) manpage (9.1 release, updated jan 25,2013), I 
find the description of partition types a bit confusing.

Considering the case of a MoBo with "old way" Bios (non UEFI), the only 
scheme allowed to get a bootable system is MBR. (Note that after 
booting, your OS is able to manage gpt-scheme on different providers.)

Then, if you speak "bsd-ish", you are able to add on the "MBR"-scheme 
provider up to 4 "freebsd-type" slices, each of them containing up to 8 
partitions with a BSD filesystem (or swap space).

Or, if you speak "msdos-ish", you would be able to add on the "MBR" 
provider up to 4 "msdos-type" partitions (or 3 + 1 extended ), each of 
them containing one filesystem.

The manpage does'nt list explicitly the type for this second case; 
Oliver try to use "mbr", decribed as "A partition that is 
sub-partitioned by a Master Boot Record (MBR). This type is known as 
"!024dee41-33e7-11d3-9d69-0008c781f39f " by GPT.". Such definition is'nt 
very explicit.

Let me show the example below on my provider ada0 :

> $ gpart show
> =>       63  976773105  ada0  MBR  (465G)
>          63  136314864     1  freebsd  [active]  (65G)
>   136314927  840458241        - free -  (400G)
>
> =>        0  136314864  ada0s1  BSD  (65G)
>           0    8388608       1  freebsd-ufs  (4.0G)
>     8388608   16777216       2  freebsd-swap  (8.0G)
>    25165824   16777216       4  freebsd-ufs  (8.0G)
>    41943040    8388608       5  freebsd-ufs  (4.0G)
>    50331648   85983215       6  freebsd-ufs  (41G)
>   136314863          1          - free -  (512B)
>
> $ sudo gpart add -t mbr -i 2 -s 8G ada0
> Password:
> gpart: Invalid argument
>
> $ sudo gpart add -t \!12 -i 2 -s 8G ada0
> ada0s2 added
> $
> $ sudo newfs_msdos ada0s2
> /dev/ada0s2: 16773056 sectors in 262079 FAT32 clusters (32768 
> bytes/cluster)
> BytesPerSec=512 SecPerClust=64 ResSectors=32 FATs=2 Media=0xf0 
> SecPerTrack=63 Heads=16 HiddenSecs=0 HugeSectors=16777215 FATsecs=2048 
> RootCluster=2 FSInfo=1 Backup=2
> $ sudo gpart add -t freebsd -i 3 -s 8G ada0
> ada0s3 added
> $ gpart show ada0
> =>       63  976773105  ada0  MBR  (465G)
>          63  136314864     1  freebsd  [active]  (65G)
>   136314927   16777215     2  !12  (8G)
>   153092142   16777215     3  freebsd  (8G)
>   169869357  806903811        - free -  (384G)
> $ sudo newfs_msdos ada0s3
> /dev/ada0s3: 16773056 sectors in 262079 FAT32 clusters (32768 
> bytes/cluster)
> BytesPerSec=512 SecPerClust=64 ResSectors=32 FATs=2 Media=0xf0 
> SecPerTrack=63 Heads=16 HiddenSecs=0 HugeSectors=16777215 FATsecs=2048 
> RootCluster=2 FSInfo=1 Backup=2
> $ 
this example show that, if you want a "msdos" or "fat32" partition, both 
the type "\!12" or "freebsd" allows you  to create a partition where you 
could install a msdos filesystem (but the "mbr" does not).

Such behaviour is not surprising, (using freebsd-type to format as 
msdos  means you don't use the space allowed for labeling); but what is 
really the purpose of the listed "mbr"-type in the gpart(8) manpage?

Cheers

Roger
Received on Fri Jun 21 2013 - 13:07:34 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:38 UTC