免费注册 查看新帖 |

Chinaunix

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

为FreeBSD添加新硬盘 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-07 08:37 |只看该作者 |倒序浏览
本文介绍手工为FreeBSD添加新硬盘的一般性方法。假设我们的FreeBSD已经有了一块IDE硬盘,我们需要为它添加一块新的IDE硬盘,并把新添加的硬盘的所有空间作为一个分区加载到/disk1下面。
基础知识
FreeBSD分区描述符为从"a"到"h"的8个字母。根据惯例,分区"c"被保留用作描述整个磁盘,"a"用作标识根分区,"b"用作标识交换分区。对于新添加的硬盘,我们常常只建立一个分区,标识为"e"。
IDE硬盘标记为ad,而SCSI硬盘标记为da,从0开始计数,因此,我们新添加的IDE硬盘将作为ad1出现在系统中。
一般步骤
把新的IDE硬盘接入系统,并确认开机以后系统找到了新添加的硬盘。可以通过检查/var/run/dmesg.boot来确认系统是否找到新添加的硬盘。
准备
vms# dd if=/dev/zero of=/dev/rad1 bs=1k count=1
1+0 records in
1+0 records out
1024 bytes transferred in 0.000822 secs (1245640 bytes/sec)
vms#
初始化磁盘
vms# fdisk -BI ad1
******* Working on device /dev/ad1 *******
fdisk: invalid fdisk partition table found
vms#
建立FreeBSD分区
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#
建立逻辑分区
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

另外一种方法:
直接在SYSINSTALL里搞定.
SYSINSTALL
CONFIGURE
FDISK分区
LABLE
完成.

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/13956/showart_124390.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP