FreeBSD

From DikapediaV2
Jump to: navigation, search

Network config file location:

  • /etc/rc.conf
  • Default EC2 instance:
# cat /etc/rc.conf
ec2_configinit_enable=YES
ec2_fetchkey_enable=YES
ec2_ephemeralswap_enable=YES
ec2_loghostkey_enable=YES
firstboot_freebsd_update_enable=YES
firstboot_pkgs_enable=YES
growfs_enable="YES"
ifconfig_DEFAULT="SYNCDHCP"
sshd_enable="YES"
firstboot_pkgs_list="awscli"


https://www.serverlab.ca/tutorials/unix/how-to-set-static-ip-and-dhcp-in-freebsd/



LSBLK equivalent in FreeBSD:

$ geom disk list 
Geom name: ada0
Providers:
1. Name: ada0
Mediasize: 10737418240 (10G)
Sectorsize: 512
Mode: r1w1e3
descr: (null)
ident: (null)
rotationrate: unknown
fwsectors: 0
fwheads: 0

Geom name: xbd5
Providers:
1. Name: xbd5
Mediasize: 10737418240 (10G)
Sectorsize: 512
Mode: r0w0e0
descr: (null)
ident: (null)
rotationrate: unknown
fwsectors: 0
fwheads: 0


Check /dev/ for list of devices:

# ls -al /dev/
.
.
xbd5
xbd5p1
xbd5p2

Or you can run gpart list to get the device names:

$ gpart list
Geom name: ada0
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 20971517
first: 3
entries: 4
scheme: GPT
Providers:
1. Name: ada0p1   <------------------------------ NOTICE
   Mediasize: 16384 (16K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1536
   Mode: r0w0e0
   rawuuid: 8de15aa6-358e-11e7-b3b3-002590ec5bf2
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   label: bootfs
   length: 16384
   offset: 1536
   type: freebsd-boot
   index: 1
   end: 34
   start: 3
2. Name: ada0p2   <------------------------------ NOTICE
   Mediasize: 10737399296 (10G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17920
   Mode: r1w1e2
   rawuuid: 8de15aae-358e-11e7-b3b3-002590ec5bf2
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: rootfs
   length: 10737399296
   offset: 17920
   type: freebsd-ufs
   index: 2
   end: 20971517
   start: 35
Consumers:
1. Name: ada0
   Mediasize: 10737418240 (10G)
   Sectorsize: 512
   Mode: r1w1e3 

Geom name: xbd5
modified: false
state: OK
fwheads: 255
fwsectors: 63
last: 20971517
first: 3
entries: 4
scheme: GPT
Providers:
1. Name: xbd5p1   <------------------------------ NOTICE
   Mediasize: 16384 (16K)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 1536
   Mode: r0w0e0
   rawuuid: 8de15aa6-358e-11e7-b3b3-002590ec5bf2
   rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
   label: bootfs
   length: 16384
   offset: 1536
   type: freebsd-boot
   index: 1
   end: 34
   start: 3
2. Name: xbd5p2   <------------------------------ NOTICE
   Mediasize: 10737399296 (10G)
   Sectorsize: 512
   Stripesize: 0
   Stripeoffset: 17920
   Mode: r0w0e0
   rawuuid: 8de15aae-358e-11e7-b3b3-002590ec5bf2
   rawtype: 516e7cb6-6ecf-11d6-8ff8-00022d09712b
   label: rootfs
   length: 10737399296
   offset: 17920
   type: freebsd-ufs
   index: 2
   end: 20971517
   start: 35
Consumers:
1. Name: xbd5
   Mediasize: 10737418240 (10G)
   Sectorsize: 512
   Mode: r0w0e0