博客统计信息

51cto推荐博客
用户名:hexianguo
文章数:86
评论数:274
访问量:254625
无忧币:4315
博客积分:2240
博客等级:6
注册日期:2008-03-13

HP-UX下创建文件系统
2009-03-24 12:23:22
什么是文件系统
UNIX的文件系统是一些文件和目录的集合。每个文件系统被存储在单独的逻辑卷或整个硬盘分区上。典型的HP-UX主机通常有多个文件系统。下面是你的机器上可能存在的几个文件系统:
    /usr下的文件通常被存储在一个文件系统中。
    /var下的文件通常被存储在另一个文件系统中。
    /tmp下的文件通常也被存储在另一个文件系统中。
    根文件系统是一个包含/etc/dev/sbin等目录的特殊文件系统。
配置多个文件系统的优点
虽然你的文件和目录都可以被存储在根文件系统中,但将文件目录放到各个单独的文件系统中有很多好处:
    系统管理员能给每个文件系统分配固定的硬盘空间,保证不让一个文件系统独占整个硬盘。系统管理员也许会分配100MB空间给/tmp文件系统,这保证了/tmp下的临时文件最多可以使用系统上的100MB硬盘空间,硬盘上的剩余空间可以保留给其他文件系统。
    各个文件系统可以被分别调整,许多与文件系统有关的参数能够极大地影响系统的性能。一些文件系统可能因存储大文件而被优化,另一些则可能因存储小文件被优化。
    可在一个文件系统上执行文件系统维护任务,而其他文件系统仍可继续被用户使用。
创建一个文件系统的步骤
第一步:创建PV,把c0t2d0这块磁盘加入到一个PV
# pvcreate /dev/rdsk/c0t2d0    //此时磁盘为裸设备,所以是rdsk
Physical volume "/dev/rdsk/c0t2d0" has been successfully created.
第二步:创建VG
# mkdir /dev/vg01  
# mknod /dev/vg01/group c 64 0x010000  //创建一个控制器文件,指定主号为64,次号为0x010000
# vgcreate /dev/vg01 /dev/dsk/c0t2d0   //c0t2d0这个磁盘去创建一个vg01
Increased the number of physical extents per physical volume to 8683.
Volume group "/dev/vg01" has been successfully created.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
第三步:创建LV
# lvcreate -L 200 -n lv_test vg01    //vg01中创建一个名为lv_test大小为200M的文件系统
Logical volume "/dev/vg01/lv_test" has been successfully created with
character device "/dev/vg01/rlv_test".
Logical volume "/dev/vg01/lv_test" has been successfully extended.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
第四步:创建文件系统
# newfs -F vxfs /dev/vg01/rlv_test   //创建文件系统,可以不加-F vxfs参数,默认就是vxfs文件系统
    version 4 layout
    204800 sectors, 204800 blocks of size 1024, log size 1024 blocks
    unlimited inodes, largefiles not supported
    204800 data blocks, 203656 free data blocks
    7 allocation units of 32768 blocks, 32768 data blocks
    last allocation unit has 8192 data blocks
# mkdir /lv_test    //创建一个挂载点
# mount /dev/vg01/lv_test /lv_test  //挂载新建的文件系统
# bdf
Filesystem          kbytes    used   avail %used Mounted on
/dev/vg00/lvol3    2048000  144864 1888296    7% /
/dev/vg00/lvol1     990968   60888  830976    7% /stand
/dev/vg00/lvol8    6144000  862544 5241400   14% /var
/dev/vg00/lvol7    4096000 1389016 2685880   34% /usr
/dev/vg00/lvol5    8192000  710896 7422720    9% /tmp
/dev/vg00/lvol4    8192000 2832160 5318008   35% /opt
/dev/vg00/lvol6    1024000    3024 1013064    0% /home
/dev/vg00/gmylv      16384    1109   14328    7% /gmylv
/dev/vg01/lv_test   204800    1157  190923    1% /lv_test       //已经挂到系统上
#
现在来测试一下,我们FTP到系统,上传一个名为test,内容也为test的文本文件上去
C:\Documents and Settings\xghe>d:
 
D:\>ftp 192.168.0.1
Connected to 192.168.0.1.
220 hp FTP server (Version 1.1.214.4(PHNE_34544) Fri Feb 24 15:03:24 GMT 2006)
eady.
User (192.168.0.1:(none)): root
331 Password required for root.
Password:
230 User root logged in.
ftp> pwd
257 "/" is current directory.
ftp> cd /lv_test
250 CWD command successful.
ftp> binary        //将传输方式改为二进制,默认为ASCii
200 Type set to I.
ftp> put test.txt   //put表示上传
200 PORT command successful.
150 Opening BINARY mode data connection for test.txt.
226 Transfer complete.
ftp: 发送 4 字节,用时 0.00Seconds 4000.00Kbytes/sec.
ftp>
 
# cd /lv_test
# ll
total 2
drwxr-xr-x   2 root       root            96 Mar 24 11:24 lost+found
-rw-r-----   1 root       sys              4 Mar 24 11:28 test.txt
# cat test.txt
test                 //试验完!
 
 
分享至
更多
一键收藏,随时查看,分享好友!
0人
了这篇文章
类别:Unix&Linux技术圈()┆阅读()┆评论() ┆ 推送到技术圈返回首页

文章评论

 
2009-04-22 18:37:07
坐下来慢慢看。呵呵

2010-07-01 16:25:08


n. People [b][url=http://www.discountwatchmvp.com]rolex watches[/url][/b] with a lot of [b][url=http://www.discountwatchmvp.com]copy rolex watch[/url][/b] expertise and technical acumen [b][url=http://www.discountwatchmvp.com]rolex watches[/url][/b] are employed to design [b][url=http://www.discountwatchmvp.com]cheap rolex watches[/url][/b] these watches so that [b][url=http://www.discountwatchmvp.com]quality rolex watches[/url][/b] they resemble the original [b][url=http://www.discountwatchmvp.com]rolex fake watches[/url][/b] models

2010-07-01 16:25:16

ouflage unlike <b><a href=http://www.discountwatchmvp.com>rolex watches</a></b> things that dispatch not <b><a href=http://www.discountwatchmvp.com>rolex watches</a></b> gain goodies due to <b><a href=http://www.discountwatchmvp.com>rolex watches</a></b> the elegance tradition though <b><a href=http://www.discountwatchmvp.com>replica rolex watch</a></b> not of the temple <b><a href=http://www.discountwatchmvp.com>lady's rolex watch</a></b> does not concur the <b><a href=http://www.discountwatchmvp.com>fake rolex watch</a></b> eating of splinter feed <b><a href=http://www.discountwatchmvp.com>imitation rolex watch</a></b> that is not fish. <b><a href=http://www.discountwatchmvp.com>discount rolex watches</a></b> I force my fixed <b><a href=http://www.discountwatchmvp.com>rolex watches</a></b> adjudication raise not to <b><a href=http://www.discountwatchmvp.com>rolex watches</a></b> eat each dish for I reunite on proper 3 or 4 of them over my beauty buds elevate to sca


 

发表评论            

【技术门诊】专家解析:软考重点难点及应试技巧
昵  称:
登录  快速注册
验证码:

请点击后输入验证码博客过2级,无需填写验证码

内  容: