免费注册 查看新帖 |

Chinaunix

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

急切想知道:如何在sun中为文件系统扩容 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-08-23 17:23 |只看该作者 |倒序浏览
想请教一下如何在sun中为文件系统扩容,就像hpux的:
lvcreate -L 500m -n xx /dev/vg01;
umount /mountpoint
extendfs ...一样
说有过实际经验不妨贴出来共享,加倍感谢

论坛徽章:
0
2 [报告]
发表于 2006-08-23 17:38 |只看该作者
hp-ux下面有个OEM的veritas所以可以做到,sun没有买veritas的话可以用sds,相对麻烦,自己找文档研究吧。

论坛徽章:
0
3 [报告]
发表于 2006-08-24 08:44 |只看该作者
原帖由 nus 于 2006-8-23 17:38 发表
hp-ux下面有个OEM的veritas所以可以做到,sun没有买veritas的话可以用sds,相对麻烦,自己找文档研究吧。


文档在这里, 1M 第553页,基于很多朋友不一定下载了文档,直接贴在这里

growfs – non-destructively expand a UFS file system

/usr/sbin/growfs [-M mount-point] [newfs-options] [raw-device]

growfs non-destructively expands a mounted or unmounted UNIX file system (UFS)
to the size of the file system’s slice(s).

Typically, disk space is expanded by first adding a slice to a metadevice, then running
the growfs command. When adding space to a mirror, you expand each submirror
before expanding the file system.

growfs will ‘‘write-lock’’ (see lockfs(1M)) a mounted file system when expanding.
The length of time the file system is write-locked can be shortened by expanding the
file system in stages. For instance, to expand a 1 Gbyte file system to 2 Gbytes, the file
system can be grown in 16 Mbyte stages using the -s option to specify the total size of
the new file system at each stage. The argument for -s is the number of sectors, and
must be a multiple of the cylinder size. Note: The file system cannot be grown if a
cylinder size of less than 2 is specified. Refer to the newfs(1M) man page for
information on the options available when growing a file system.

growfs displays the same information as mkfs during the expansion of the file
system.

If growfs is aborted, recover any lost free space by unmounting the file system and
running the fsck command, or run the growfs command again.

Root privileges are required for all of the following options.

-M mount-point
The file system to be expanded is mounted on mount-point. File system locking
(lockfs) will be used.

newfs-options
The options are documented in the newfs man page.

raw-device
Specifies the name of a raw metadevice or raw special device, residing in
/dev/md/rdsk, or /dev/rdsk, respectively, including the disk slice, where you
want the file system to be grown.

EXAMPLE 1 Expanding nonmetadevice slice for /export file system
The following example expands a nonmetadevice slice for the /export file system. In
this example, the existing slice, /dev/dsk/c1t0d0s3, is converted to a metadevice
so additional slices can be concatenated.

# metainit -f d8 2 1 c1t0d0s3 1 c2t0d0s3
# umount /export

EXAMPLE 2 Associate /export with new metadevice
Edit the /etc/vfstab file to change the entry for /export to the newly defined
metadevice, d8.

# mount /export
# growfs -M /export /dev/md/rdsk/d8

The first example starts by running the metainit command with the -f option to
force the creation of a new concatenated metadevice d8, which consists of the existing
slice /dev/dsk/c1t0d0s3 and a new slice /dev/dsk/c2t0d0s3. Next, the file
system on /export must be unmounted. The /etc/vfstab file is edited to change
the entry for /export to the newly defined metadevice name, rather than the slice
name. After the file system is remounted, the growfs command is run to expand the
file system. The file system will span the entire metadevice when growfs completes.
The -M option enables the growfs command to expand a mounted file system.
During the expansion, write access for /export is suspended until growfs unlocks
the file system. Read access is not affected, though access times are not kept when the
lock is in effect.

EXAMPLE 3 Dynamic Expansion of /export file system
The following example picks up from the previous one. Here, the /export file system
mounted on metadevice d8 is dynamically expanded.

# metattach d8 c0t1d0s2
# growfs -M /export /dev/md/rdsk/d8

This example begins by using the metattach command to dynamically concatenate a
new slice, /dev/dsk/c0t1d0s2, to the end of an existing metadevice, d8. Next, the
growfs command specifies that the mount-point is /export and that it is to be
expanded onto the raw metadevice /dev/md/rdsk/d8. The file system will span the
entire metadevice when growfs completes. During the expansion, write access for
/export is suspended until growfs unlocks the file system. Read access is not
affected, though access times are not kept when the lock is in effect.

EXAMPLE 4 Expanding mounted file system to existing mirror
The following example expands a mounted file system /files, to an existing mirror,
d80, which contains two submirrors, d9 and d10.

# metattach d9 c0t2d0s5
# metattach d10 c0t3d0s5
# growfs -M /files /dev/md/rdsk/d80

In this example, the metattach command dynamically concatenates the new slices to
each submirror. The metattach command must be run for each submirror. The
mirror will automatically grow when the last submirror is dynamically concatenated.
The mirror will grow to the size of the smallest submirror. The growfs command then
expands the file system. The growfs command specifies that the mount-point is
/files and that it is to be expanded onto the raw metadevice /dev/md/rdsk/d80.
The file system will span the entire mirror when the growfs command completes.
During the expansion, write access for the file system is suspended until growfs

unlocks the file system. Read access is not affected, though access times are not kept
when the lock is in effect.

The following exit values are returned:
0 Successful completion.
>0 An error occurred.

论坛徽章:
0
4 [报告]
发表于 2013-11-06 16:12 |只看该作者
新手学习了

论坛徽章:
0
5 [报告]
发表于 2013-11-15 15:18 |只看该作者
lollollol

论坛徽章:
3
2015年辞旧岁徽章
日期:2015-03-03 16:54:15操作系统版块每日发帖之星
日期:2016-01-21 06:20:00操作系统版块每日发帖之星
日期:2016-08-11 06:20:00
6 [报告]
发表于 2013-12-04 20:28 |只看该作者
好东东,从来没有用过的

论坛徽章:
0
7 [报告]
发表于 2013-12-05 18:04 |只看该作者
回复 1# yyfyyf


    你能说一下环境么 ?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP