UFS Configuring swap in GPT

Hello, I'm new to freebsd (coming from linux)

I'm reading through the handbook and got a bit confused in this section. There it's stated that disks are organized into slices and each slice is organized into partitions, and the 'b' partition is used for swap. I guess that this is true only in MBR-based partitioning scheme, because I installed freebsd into a gpt partition and it doesn't seem to be divided further into bsd partitions (ls output in /dev shows an entry ada1p4 - this is where bsd installed. no futher division with letters). The manual page doesn't clarify how disk organization representation in the system differs between MBR and GPT, which got me confused (I guess it just assumes MBR)

So if I have a dedicated gpt swap partition on the same disk, is freebsd able use it, just like linux does, if I have this entry in /etc/fstab?

# Device Mountpoint FStype Options Dump Pass
/dev/ada1p2 none swap sw 0 0

ada1p2 is a gpt swap partition
Is any extra configuration needed?
 
(I guess it just assumes MBR)
That's correct. The handbook still assumes MBR and hasn't been updated to add the differences with GPT.

So if I have a dedicated gpt swap partition on the same disk, is freebsd able use it, just like linux does, if I have this entry in /etc/fstab?
Code:
# Device Mountpoint FStype Options Dump Pass
/dev/ada1p2 none swap sw 0 0
That's the right way to do it.

Code:
root@molly:~ # gpart show ada0
=>       34  976773101  ada0  GPT  (466G)
         34       1024     1  freebsd-boot  (512K)
       1058          6        - free -  (3.0K)
       1064   33554432     2  freebsd-swap  (16G)
   33555496  943217632     3  freebsd-zfs  (450G)
  976773128          7        - free -  (3.5K)

root@molly:~ # swapinfo
Device          512-blocks     Used    Avail Capacity
/dev/gpt/swap0    33554432   969168 32585264     3%
 
I'd recommend to use GPT partition labels like SirDice showed above.
gpart show -l
Code:
=>       40  500118112  ada0  GPT  (238G)
         40     409600     1  efiboot0  (200M)
409640 1024 2 gptboot0 (512K)
410664 25165824 3 IRST (12G)
25576488 8388608 4 DUMP (4.0G)
33965096 466153056 5 T450s (222G)
swapinfo -h
Code:
/dev/gpt/DUMP     4194304     110M     3.9G     3%
/dev/zvol/t450s/SWAP  12582912     112M      12G     1%
For UFS, you can enhance throughput & inactivity by inserting the I/O scheduler. For desktop/laptop, note Howto: Hibernation.
 
Back
Top