adding new disk >2TB, gpt?

Robert Simmons rsimmons0 at gmail.com
Mon May 16 19:22:47 UTC 2011


On Mon, May 16, 2011 at 10:27 AM, n dhert <ndhertbsd at gmail.com> wrote:
> I have a running FreeBSD-8.2-amd system,
> FreeBSD was installed in jan 2009 (then FreeBSD 7.0), which a fisk disk of
> 200 GB
> for /, swap /usr /var /tmp.
> Later that month, I added a 9 TB disk using /sbin/gpt
> (since sysinstall uses bsdlabel/fdisk, it can't create disks larger than 2
> TB)
>
> I want to add an extra >2TB disk... and thought to use gpt again as I did in
> the past ..
>
> The FreeBSD book (in its 2011 version), section 18.3 still refers to using
> gpt for disks >2TB
> but the link gpt(8) leads to nowhere and /sbin/gpt no longer exists in
> FreeBSD !
>
> There seem to be two alternatives:
> 1) /sbin/gpart, of which the man page is quite similar to what gpt used to
> be, but tells me
> it is ''for disk partitoning GEOM class",
> whereas gpt man pages (in 2009) said: gpt - "GUID partition table
> maintenance utility".
>
> 2) a port sysutils/gdisk of which the Long Description says:
>  "Edit GUID partition table (GPT) definitions in Linux, FreeBSD, MacOS X or
> Windows"
> but its web site shows a completely different command line interface, not
> resembling the old gpt at all..
>
> What is exactly that difference between GEOM and GUID ?
> I'd like to have things as similar as possible ..
> Can I use /sbin/gpart for the extra 9 GB disk ? or do I have to stick with
> GUID and use gdisk ?

gpart create -s gpt ad0
is the command you want to use.  Just replace ad0 with your device
node. Also, "gpart show" will give a list of slices and partitions.
You will then want to do:
gpart add -s <size> -t <type> ad0
The size and type syntax are in the gpart man page.
If you want it bootable you will need a small partition at the
beginning of the disk:
gpart add -s 128k -t freebsd-boot ad0
gpart bootcode -b /boot/pmbr -p /boot/gptboot -i 1 ad0

You may adjust the size to shrink it to exactly fit the files, but I
think if you're working in TBs you can spare a few wasted k.

I submitted a PR to get the handbook updated to reflect gpart(8).

Cheers,
Rob


More information about the freebsd-questions mailing list