FreeBSD 添加新硬盘

fdisk -B da1
disklabel -e da1s1

# disklabel -e ad1s1

/dev/da0s1:
8 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:  1048576        0    4.2BSD        0     0     0
  b:  2097152  1048576      swap
  c: 16771797        0    unused        0     0         # "raw" part, don't edit
  d:  4194304  3145728    4.2BSD        0     0     0
  e:  4194304  7340032    4.2BSD        0     0     0
  f:  2097152 11534336    4.2BSD        0     0     0
  g:  2097152 13631488    4.2BSD        0     0     0
  h:  1043156 14674646    4.2BSD        0     0     0


offset = 当前分区的大小 + 上一个分区的offset
size 与实际空间大小的换算 size / (1024 * 1024 * 2)

#8G partition  16777216
16777216 =  1024 * 1024 * 2 * 8G


# - "Size in MB" = sectors * 512 / 1024 / 1024 
# - "Number of blocks" = xsize in mb * 1024 * 1024 / 512


初始化磁盘
fdisk -BI da0

fdisk -B da1

vms# fdisk -BI ad1



建立FreeBSD分区
disklabel -B -w -r da1s1
vms# disklabel -B -w -r ad1s1 auto
vms# Feb 23 14:01:40 /kernel: ad1: cannot find label (no disk label)
Feb 23 14:01:40 /kernel: ad1s1: cannot find label (no disk label)
Feb 23 14:01:40 /kernel: ad1: cannot find label (no disk label)
Feb 23 14:01:40 /kernel: ad1s1: cannot find label (no disk label)
vms#


建立逻辑分区
 f:  2097152 11534336    4.2BSD        0     0     0
 partitions:
#        size   offset    fstype   [fsize bsize bps/cpg]
  a:   917504        0    4.2BSD        0     0     0
  b:  3367880   917504      swap
  c: 20964762        0    unused        0     0         # "raw" part, don't edit
  d:  1638400  4285384    4.2BSD        0     0     0
  e:   851968  5923784    4.2BSD        0     0     0
  f: 14189010  6775752    4.2BSD        0     0     0


parameters extracted from in-core disklabel are:
cylinders=2610 heads=255 sectors/track=63 (16065 blks/cyl)

Figures below won't work with BIOS for partitions not in cyl 1
parameters to be used for BIOS calculations are:
cylinders=2610 heads=255 sectors/track=63 (16065 blks/cyl)


Media sector size is 512
Warning: BIOS sector numbering starts with sector 1
Information from DOS bootblock is:
The data for partition 1 is:
sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
    start 63, size 41929587 (20473 Meg), flag 80 (active)
        beg: cyl 0/ head 1/ sector 1;
        end: cyl 561/ head 254/ sector 63

vms# disklabel -e ad1s1

type: unknown
disk: amnesiac
label:
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 16
sectors/cylinder: 1008
cylinders: 18931
sectors/unit: 19083393
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0


headswitch: 0 # milliseconds

track-to-track seek: 0 # milliseconds
drivedata: 0
8 partitions:


# size offset fstype [fsize bsize bps/cpg]
c: 19083393 0 unused 0 0 # (Cyl. 0 - 18931*)
e: 19083393 0 4.2BSD 4096 8192 16 # (Cyl. 0 - 18931*)

格式化分区,创建文件系统
vms# newfs /dev/ad1s1e
Warning: Block size and bytes per inode restrict cylinders per group to 67.
Warning: 3968 sector(s) in last cylinder unallocated
/dev/ad1s1e: 19083392 sectors in 4660 cylinders of 1 tracks, 4096 sectors
9318.1MB in 70 cyl groups (67 c/g, 134.00MB/g, 8512 i/g)
super-block backups (for fsck -b #) at:

32, 274464, 548896, 823328, 1097760, 1372192, 1646624, 1921056, 2195488, 2469920, 2744352, 3018784, 
3293216, 3567648,
3842080, 4116512, 4390944, 4665376, ...

加载分区

vms# mkdir -p /disk1
vms# mount -t ufs /dev/ad1s1e /disk1
/usr/local/share/snmp/snmpd.conf: line 61: Error: example config COMMUNITY not properly configured
net-snmp: 1 error(s) in config file(s)
/etc/snmpd.conf: line 147: Error: Already have an entry for this process.
/etc/snmpd.conf: line 150: Error: Already have an entry for this process.
/etc/snmpd.conf: line 153: Error: Already have an entry for this process.
duplicate table data attempted to be entered. row exists
Failed to register extend entry 'echotest' - possibly duplicate name.
NET-SNMP version 5.4.2.1

你可能感兴趣的:(FreeBSD)