免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2178 | 回复: 6

[FreeBSD] 分个创建新slice的问题 [复制链接]

论坛徽章:
0
发表于 2008-07-30 23:19 |显示全部楼层
搜索了半天,实在找不到合适的答案,上来问一下。

我安装的时候,在ad0上创建了一个slice,即ad0s1,里面有ad0s1a,ad0s1b,ad0s1等,这个slice用了差不多13G空间。

  1. bsd# bsdlabel  /dev/ad0s1
  2. # /dev/ad0s1:
  3. 8 partitions:
  4. #        size   offset    fstype   [fsize bsize bps/cpg]
  5.   a:  1048576        0    4.2BSD        0     0     0
  6.   b:  2029152  1048576      swap
  7.   c: 27262242        0    unused        0     0         # "raw" part, don't edit
  8.   d:  3110912  3077728    4.2BSD        0     0     0
  9.   e:  1048576  6188640    4.2BSD        0     0     0
  10.   f: 10485760  7237216    4.2BSD        0     0     0
  11.   g:  9539266 17722976    4.2BSD        0     0     0
复制代码


现在上面只有一个系统,我想倒一下数据,想在未用的ad0上再分一个slice出来,ad0s2,在sysinstall中,分label的时候一直出错,因为在ad0s1b中的swap分区偿试再次写入失败(在用)。

用命令行下的fdisk好象分出来了slice ad0s2,但/dev下面没有设备文件/dev/ad0s2*:



  1. [color=red]重启了一下,/dev/ad0s2的设备文件有了[/color]
  2. bsd# fdisk /dev/ad0
  3. ******* Working on device /dev/ad0 *******
  4. parameters extracted from in-core disklabel are:
  5. cylinders=116301 heads=16 sectors/track=63 (1008 blks/cyl)

  6. Figures below won't work with BIOS for partitions not in cyl 1
  7. parameters to be used for BIOS calculations are:
  8. cylinders=116301 heads=16 sectors/track=63 (1008 blks/cyl)

  9. Media sector size is 512
  10. Warning: BIOS sector numbering starts with sector 1
  11. Information from DOS bootblock is:
  12. The data for partition 1 is:
  13. sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
  14.     start 63, size 27262242 (13311 Meg), flag 80 (active)
  15.         beg: cyl 0/ head 1/ sector 1;
  16.         end: cyl 1023/ head 254/ sector 63
  17. The data for partition 2 is:
  18. sysid 165 (0xa5),(FreeBSD/NetBSD/386BSD)
  19.     start 27262305, size 41929650 (20473 Meg), flag 80 (active)
  20.         beg: cyl 1023/ head 255/ sector 63;
  21.         end: cyl 1023/ head 254/ sector 63
  22. The data for partition 3 is:
  23. <UNUSED>
  24. The data for partition 4 is:
  25. <UNUSED>
  26. bsd#
复制代码


  1. bsd# ls /dev/ad0*
  2. /dev/ad0        /dev/ad0s1a     /dev/ad0s1c     /dev/ad0s1e     /dev/ad0s1g
  3. /dev/ad0s1      /dev/ad0s1b     /dev/ad0s1d     /dev/ad0s1f

  4. bsd#
复制代码


如何在使用中的硬盘上,在空的空间中划分一个新的slice出来呢?


重启了一下,/dev/ad0s2的设备文件有了

[ 本帖最后由 moxnet 于 2008-7-31 00:27 编辑 ]

论坛徽章:
0
发表于 2008-07-30 23:27 |显示全部楼层
你是说原来整个硬盘分一块ad0s1,另外没分,装完系统再分那块ad0s2分不了?

论坛徽章:
0
发表于 2008-07-30 23:31 |显示全部楼层
现在硬盘上只使用了前面的一部分,ad0s1
需要在空余的部分中先分出一部分空间做为ad0s2,这是问题所在

论坛徽章:
2
亥猪
日期:2014-03-19 16:36:35午马
日期:2014-11-23 23:48:46
发表于 2008-07-31 09:18 |显示全部楼层
swapoff -a 之后可以用sysinstall那个那个什么
我记得sysinstall里面不用mount的,好像有一个write的功能,直接写了就好了。
应该需要重启,GEOM好像没检测到disk拓扑的变化,重启了就对了。

论坛徽章:
0
发表于 2008-08-01 00:00 |显示全部楼层
原帖由 gvim 于 2008-7-31 09:18 发表
swapoff -a 之后可以用sysinstall那个那个什么
我记得sysinstall里面不用mount的,好像有一个write的功能,直接写了就好了。
应该需要重启,GEOM好像没检测到disk拓扑的变化,重启了就对了。





write的时候他会提示,说如果是首次安装,不要write;如果是新添加,要在label的时候保存,这儿只是用来修改已存在的slice。

当时无论如何,我就write了。。。

swapoff -a.... oh, i forgot that...


无论如何,在dump and restore的时候弄丢了许多文件,导致。。。通过ports安装的软件几乎都不能用了



  1. DESCRIPTION
  2.      The tunefs utility is designed to change the dynamic parameters of a file
  3.      system which affect the layout policies.  The tunefs utility cannot be
  4.      run on an active file system.  To change an active file system, it must
  5.      be downgraded to read-only or unmounted.
复制代码

论坛徽章:
2
亥猪
日期:2014-03-19 16:36:35午马
日期:2014-11-23 23:48:46
发表于 2008-08-01 09:59 |显示全部楼层
前段时间分过新slice,也分过新partition。分了一个slice装Linux,原来的BSD分了两个partition出来做实验。。。就是用的sysinstall 多备份,多尝试,就好啦。

论坛徽章:
0
发表于 2008-08-01 11:10 |显示全部楼层

回复 #6 gvim 的帖子

有道理,多试是正道,自学成才!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP