- 论坛徽章:
- 0
|
VMware下solaris x86平台
新增一磁盘c1t1d0 大小5G
分区表信息如下:
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wm 0 0 (0/0/0) 0
2 backup wu 0 - 648 4.97GB (649/0/0) 10426185
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 1 - 648 4.96GB (648/0/0) 10410120
8 boot wu 0 - 0 7.84MB (1/0/0) 16065
9 unassigned wm 0 0 (0/0/0) 0
建文件系统并mount到/mnt
/@mysolaris#newfs /dev/rdsk/c1t1d0s7
newfs: construct a new file system /dev/rdsk/c1t1d0s7: (y/n)? y
Warning: 7560 sector(s) in last cylinder unallocated
/dev/rdsk/c1t1d0s7: 10410120 sectors in 689 cylinders of 240 tracks, 63 sectors
5083.1MB in 99 cyl groups (7 c/g, 51.68MB/g, 6272 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 105936, 211840, 317744, 423648, 529552, 635456, 741360, 847264, 953168,
9425488, 9531392, 9637296, 9743200, 9849104, 9955008, 10060912, 10166816,
10272720, 10378624,
/@mysolaris#mount /dev/dsk/c1t1d0s7 /mnt
/@mysolaris#df -h /mnt
Filesystem size used avail capacity Mounted on
/dev/dsk/c1t1d0s7 4.9G 5.0M 4.8G 1% /mnt
增加另一磁盘c1t2d0 大小5G,和c1t1d0一样的分区结构,但不建文件系统
现在做通过串联raid0扩展容量的试验:
/@mysolaris#umount /mnt
建串联raid0
/@mysolaris#metainit d0 2 1 c1t1d0s7 1 c1t2d0s7
d0: Concat/Stripe is setup
在/etc/vfstab中添加如下条目:
/dev/md/dsk/d0 /dev/md/rdsk/d0 /mnt ufs 2 yes -
mount /mnt
/@mysolaris#df -h /mnt
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d0 4.9G 5.0M 4.8G 1% /mnt
/@mysolaris#growfs -M /mnt /dev/md/rdsk/d0
/dev/md/rdsk/d0: 20820240 sectors in 1377 cylinders of 240 tracks, 63 sectors
10166.1MB in 197 cyl groups (7 c/g, 51.68MB/g, 6272 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 105936, 211840, 317744, 423648, 529552, 635456, 741360, 847264, 953168,
19804080, 19909984, 20015888, 20121792, 20227696, 20333600, 20439504,
20545408, 20651312, 20757216,
/@mysolaris#
/@mysolaris#df -h /mnt
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d0 9.8G 9.9M 9.7G 1% /mnt
/mnt成功扩展容量
现在的疑问是,如果我不需要这样大的空间了,把c1t2d0去掉了,mount /mnt在/dev/rdsk/c1t1d0s7上,这时候空间应该还原到了5G,但是文件系统还是显示的9.8G,请问如何收缩文件系统?
当然,我知道可以format,重新来,如果不format有其他办法吗?因为我的根磁盘下的一个片遇到该问题,不能format根磁盘的。 |
|