免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2036 | 回复: 1
打印 上一主题 下一主题

[OpenBSD] faq14配置磁盘 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-12-21 15:33 |只看该作者 |倒序浏览
今天看了下faq14配置磁盘,拿u试了一下
# disklabel wd0   显示硬盘分区表
我用u盘实验,u盘是sd0
# disklabel sd0  
disklabel: warning, DOS partition table with no valid OpenBSD partition
# /dev/rsd0c:
type: SCSI
disk: SCSI disk
label: Flash Disk      
flags:
bytes/sector: 512
sectors/track: 63
tracks/cylinder: 255
sectors/cylinder: 16065
cylinders: 250
total sectors: 4030463
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0

16 partitions:
#                size           offset  fstype [fsize bsize  cpg]
  c:          4030463                0  unused      0     0      
  i:          4028384               32   MSDOS  
看上面一行,显示的u盘分区类形msdos,挂载设备名sd0i(看前面的i)
所以说加载u盘时可以用上面的命令看一下挂载点
现修改分区类型,下面这好像就是多数人说openbsd不好安装的难点
~ # fdisk -e sd0
Enter 'help' for information
fdisk: 1> p
Disk: sd0       geometry: 250/255/63 [4030463 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
#: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
*3: 06      0   0  33 -    250 193   7 [          32:     4028384 ] DOS > 32MB  
fdisk: 1> e 3       e修改3dos类型的
            Starting         Ending         LBA Info:
#: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
*3: 06      0   0  33 -    250 193   7 [          32:     4028384 ] DOS > 32MB  
Partition id ('0' to disable)  [0 - FF]: [6] (? for help) a6        (a6 openbsd的分区类型)
Do you wish to edit in CHS mode? [n]  回车
offset: [32]     回车
size: [4028384]   回车
fdisk:*1>
fdisk:*1> p     看一下
Disk: sd0       geometry: 250/255/63 [4030463 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
#: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
0: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
1: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
2: 00      0   0   0 -      0   0   0 [           0:           0 ] unused      
*3: A6      0   0  33 -    250 193   7 [          32:     4028384 ] OpenBSD     
fdisk:*1> q  修改完毕保存退出
Writing current MBR to disk.

下面修改分区相当于dos的fdisk
~ # disklabel -E sd0
disklabel: warning, DOS partition table with no valid OpenBSD partition
Treating sectors 63-4030463 as the OpenBSD portion of the disk.
You can use the 'b' command to change this.

Initial label editor (enter '?' for help at any prompt)
> p               p查看,帮助打?回车
OpenBSD area: 63-4030463; size: 4030400; free: 2047
#                size           offset  fstype [fsize bsize  cpg]
  c:          4030463                0  unused      0     0      
  i:          4028384               32   MSDOS                  
> d i            d删除分区
> p              再查看已删除i
OpenBSD area: 63-4030463; size: 4030400; free: 2047
#                size           offset  fstype [fsize bsize  cpg]
  c:          4030463                0  unused      0     0   
> a a           新建分区用a
offset: [63]    回车
size: [4030400] 1000m 分区大小1000兆     
Rounding to cylinder: 2056257  回车
FS type: [4.2BSD]  分区类型直回车
> p          在看一下已经建了分区a            
OpenBSD area: 63-4030463; size: 4030400; free: 1974143
#                size           offset  fstype [fsize bsize  cpg]
  a:          2056257               63  4.2BSD   2048 16384    1
  c:          4030463                0  unused      0     0   
> q       退出保存
Write new label?: [y] 确认回车
如果是安装的话可以接着分,a是根分区,b交换分区,c整个磁盘,d,e,f,.....需要设置挂载点
这里介绍个重要参数大写的D重建分区,如果分乱了想重来就敲个D

接下来格式化,已经知道了新建的是 sd0a
~ # newfs sd0a      
/dev/rsd0a: 1004.0MB in 2056288 sectors of 512 bytes
5 cylinder groups of 202.47MB, 12958 blocks, 25984 inodes each
super-block backups (for fsck -b #) at:
32, 414688, 829344, 1244000, 1658656,

~ # mount /dev/sd0a /mnt/                                                      
~ #
mount成功,开机自动mount可写入/etc/fstab

[ 本帖最后由 lionux 于 2008-12-21 15:36 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-12-21 22:27 |只看该作者
直接删除然后再分区不行吗?为什么要先改一下分区类型呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP