Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3268773
  • 博文数量: 815
  • 博客积分: 12898
  • 博客等级: 上将
  • 技术积分: 7883
  • 用 户 组: 普通用户
  • 注册时间: 2006-12-25 09:57
文章分类

全部博文(815)

文章存档

2014年(1)

2011年(46)

2010年(192)

2009年(121)

2008年(70)

2007年(385)

分类: BSD

2010-09-11 15:52:56

disklabel 帮助
# disklabel --help                                          
disklabel: unknown option -- -
usage: disklabel [-c | -d | -t] [-Av] [-h | -p unit] disk       (read)
       disklabel -w [-c | -d] [-Anv] disk disktype [packid]     (write)
       disklabel -e [-c | -d] [-Anv] disk                       (edit)
       disklabel -E [-c | -d] [-Anv] [-f tempfile] disk         (simple editor)
       disklabel -R [-nv] disk protofile                        (restore)
       disklabel -N | -W [-nv] disk                             (protect)

       disklabel -w [-nv] disk disktype [packid]    (write)
       disklabel -R [-nv] disk protofile [disktype] (restore)

`disk' may be of the form: sd0 or /dev/rsd0c.
`disktype' is an entry from /etc/disktab, see disktab(5) for more info.
`packid' is an identification string for the device.
`protofile' is the output from the read cmd form; -R is powerful.
For procedures specific to this architecture see: fdisk(8), installboot(8)
查看现有磁盘

# disklabel wd0                                                                
# /dev/rwd0c:
type: ESDI
disk: ESDI/IDE disk
label: VMware Virtual I
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 1044
total sectors: 16777216
rpm: 3600
interleave: 1
boundstart: 63
boundend: 16771860
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  a:         12289662               63  4.2BSD   2048 16384    1 # /
  b:          4482135         12289725    swap                   
  c:         16777216                0  unused                   
#


# disklabel wd1
# /dev/rwd1c:
type: ESDI
disk: ESDI/IDE disk
label: VMware Virtual I
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 1044
total sectors: 16777216
rpm: 3600
interleave: 1
boundstart: 0
boundend: 16777216
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:         16777216                0  unused                   
#
添加磁盘
# disklabel -E wd1
Label editor (enter '?' for help at any prompt)
> n
This option is not valid when run without the -f flag.
> ?
Available commands:
  ? [cmd]  - show help                  n [part] - set mount point
  A        - auto partition all space   p [unit] - print partitions
  a [part] - add partition              q        - quit & save changes
  b        - set OpenBSD boundaries     s [path] - save label to file
  c [part] - change partition size      r        - display free space
  D        - reset label to default     U        - undo all changes
  d [part] - delete partition           u        - undo last change
  e        - edit drive parameters      w        - write label to disk
  g [d|u]  - [d]isk or [u]ser geometry  X        - toggle expert mode
  l [unit] - print disk label header    x        - exit & lose changes
  M        - disklabel(8) man page      z        - delete all partitions
  m [part] - modify partition

Suffixes can be used to indicate units other than sectors:
        'b' (bytes), 'k' (kilobytes), 'm' (megabytes), 'g' (gigabytes)
        'c' (cylinders), '%' (% of total disk), '&' (% of free space).
Values in non-sector units are truncated to the nearest cylinder boundary.
> a
partition: [a]
offset: [0]
size: [16777216]
FS type: [4.2BSD]
> p
OpenBSD area: 0-16777216; size: 16777216; free: 0
#                size           offset  fstype [fsize bsize  cpg]
  a:         16777216                0  4.2BSD   2048 16384    1
  c:         16777216                0  unused                  
> w
> q
No label changes.
#

建立文件系统
# newfs wd1a                                               
/dev/rwd1a: 8192.0MB in 16777216 sectors of 512 bytes
41 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
super-block backups (for fsck -b #) at:
 32, 414688, 829344, 1244000, 1658656, 2073312, 2487968, 2902624, 3317280,
 3731936, 4146592, 4561248, 4975904, 5390560, 5805216, 6219872, 6634528,
 7049184, 7463840, 7878496, 8293152, 8707808, 9122464, 9537120, 9951776,
 10366432, 10781088, 11195744, 11610400, 12025056, 12439712, 12854368,
 13269024, 13683680, 14098336, 14512992, 14927648, 15342304, 15756960,
 16171616, 16586272,
#
挂载分区
# mount /dev/wd1a /mnt/                                                       
# df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
/dev/wd0a      5.8G    645M    4.8G    11%    /
/dev/wd1a      7.9G    2.0K    7.5G     0%    /mnt

# cat /etc/fstab                                                                                                                           
/dev/wd0a / ffs rw 1 1
/dev/wd1a /var ffs rw 1 1

将已有目录迁移到新磁盘

阅读(2040) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~