Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7926212
  • 博文数量: 124
  • 博客积分: 2880
  • 博客等级: 少校
  • 技术积分: 873
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-16 17:08
文章分类

全部博文(124)

文章存档

2011年(28)

2010年(60)

2009年(36)

我的朋友

分类:

2011-03-28 09:18:39

2.3.2 第二个例子

增加磁盘阵列柜第二个逻辑分区/dev/rdsk/c2b0t5d1。准备将该逻辑分区分成2fdisk分区,并将该逻辑分区的活动fdiskUNIX系统分区(第一个fdisk分区)再分成三个子分区(slice)

1. diskadd –F s5dm c2b0t5d1命令。

2. 在第一个例子的第11行处输入“n ,进入fdisk程序对该逻辑分区进行分区。

3. 分成两个fdisk分区,整个过程如下所示:

# fdisk /dev/rdsk/c2b0t5d1s0

The recommended default partitioning for your disk is:

 

  a 100% "UNIX System" partition.

 

To select this, please type "y".  To partition your disk

differently, type "n" and the "fdisk" program will let you

select other partitions.y

 

                                      Cylinders                Approx

Partition   Status       Type       Start   End   Length    %      MB

======  ====== ==========   =====   ===   ======   ===   ======

1      Active   UNIX System      0   15299    15300     45    15300.0

2               UNIX System  15300   33998    18699    55    18699.0

 

4. diskadd调用fdisk将硬盘分区完成以后调用disksetup –I /dev/rdsk/c2b0t5d1s0命令对该硬盘进行子分区(slice)。这个过程与第一个例子类似,我们可以证明划分子分区只是针对了active分区,通过下面的操作可以看出来。

1           You will now specify the size in cylinders of each slice.

2           (One megabyte of disk space is approximately 1 cylinders.)

3           There are now 15299 cylinders available on your disk.

4           The filesystem type you have chosen is limited to 1048576 cylinders.

5           How many cylinders would you like for /home/s21 (0 - 15299)?

5行中的0-15299说明该UNIX系统分区的空间是15300cylinder长度,这与用fdisk命令所划分的第1分区(当前活动的UNIX系统分区)的长度完全一样。从而印证了我们关于slice只能对硬盘的当前活动UNIX系统分区继续进行子分区的观点。

2.2.3 第三个例子

这个例子就是一个系统主机的本地IDE硬盘的第二个分区的使用情况。

我们这个例子的环境是一个IDE硬盘被分成两个fdisk分区,其中分区1安装了UnixWare7.1.x操作系统,是当前的活动的UNIX系统分区,容量为3702.4MB472cylinder,第二个分区是UNIX系统分区,容量为2470.9MB315cylinder

我们无法象OpenServer一样将第二个分区在进行细分成很多子分区,然后使用它们,只能利用mkfs命令将第二个fdisk分区作为一个整体进行使用,不能够在继续划分子分区。

                                       Cylinders                Approx

Partition   Status       Type       Start   End   Length    %      MB

=====   ====== ===========  =====   ===   ======   ===   ======

    1     Active   UNIX System      0    471     472     60    3702.4

    2             UNIX System    472    786     315     40    2470.9

 

1. mkfs –F vxfs /dev/rdsk/c0b0t0d0p2 5060475

1-F vxfs是指明要创建的文件系统。

2/dev/rdsk/c0b0t0d0p2是第二个分区对应的设备文件。

35060475是以512字节进行计算的sector数量。

4)这个命令的作用就是将第二个分区创建成一个vxfs类型的文件系统。

2. mount –F vxfs /dev/dsk/c0b0t0d0p2 /home/p2

这个命令将第二个分区mount到目录/home/p2上,我们可以象一般的文件系统一样进行使用。

2.4 删除硬盘

2.4.1 diskrm命令

diskrm [-F dm_type] [disk_number]

diskrm命令的参数与diskadd完全相同,代表的意思也完全一样,它的作用就是将/etc/vfstab文件中的相应记录删除。

2.4.2 一个例子

我们这个例子是删除我们学习环境的磁盘阵列的第二个逻辑分区/dev/[r]dsk/c2b0t5d1

我们先来看一下在没有执行命令diskrm前的/etc/vfstab的内容,我们看到第1416行都是磁盘阵列第二逻辑分区的子分区的信息。

1          # vi /etc/vfstab

2          /dev/root   /dev/rroot  /   vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

3          /dev/stand  /dev/rstand /stand  bfs 1   no  -   SYS_RANGE_MAX

4          /proc -   /proc   proc    -   no  -

5          /processorfs -   /system/processor   profs    -   yes  -

6          /dev/fd   -   /dev/fd fdfs    -   no  -

7          /dev/dsk/f0t  /dev/rdsk/f0t   /install    s5  -   no  -

8          /dev/dsk/f1t  /dev/rdsk/f1t   /install    s5  -   no  -

9          /dev/dsk/f0   /dev/rdsk/f0    /install    s5  -   no  -

10      /dev/dsk/f1   /dev/rdsk/f1    /install    s5  -   no  -

11      /tmp    -   /tmp    memfs   -   yes swapmax=10485760,rootmode=1777

12      /var/tmp    -   /var/tmp    memfs   -   yes swapmax=41943040,rootmode=1777

13      /dev/_tcp   -   /dev/_tcp   specfs  -   yes dev=tcp

14      /dev/dsk/c2b0t5d1s1 /dev/rdsk/c2b0t5d1s1    /home/s21   vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

15      /dev/dsk/c2b0t5d1s2 /dev/rdsk/c2b0t5d1s2    /home/s22   vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

16      /dev/dsk/c2b0t5d1s3 /dev/rdsk/c2b0t5d1s3    /home/s23   vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

17      /dev/dsk/c2b0t5d2s1 /dev/rdsk/c2b0t5d2s1    /home/31    vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

18      /dev/dsk/c2b0t5d2s2 /dev/rdsk/c2b0t5d2s2    /home/32    vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

19      /dev/root   /dev/rroot  /   vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

20      /dev/stand  /dev/rstand /stand  bfs 1   no  -   SYS_RANGE_MAX

21      /proc -   /proc   proc    -   no  -

22      /processorfs -   /system/processor   profs    -   yes  -

23      /dev/fd   -   /dev/fd fdfs    -   no  -

24      /dev/dsk/f0t  /dev/rdsk/f0t   /install    s5  -   no  -

25      /dev/dsk/f1t  /dev/rdsk/f1t   /install    s5  -   no  -

26      /dev/dsk/f0   /dev/rdsk/f0    /install    s5  -   no  -

27      /dev/dsk/f1   /dev/rdsk/f1    /install    s5  -   no  -

28      /tmp    -   /tmp    memfs   -   yes swapmax=10485760,rootmode=1777

29      /var/tmp    -   /var/tmp    memfs   -   yes swapmax=41943040,rootmode=1777

30      /dev/_tcp   -   /dev/_tcp   specfs  -   yes dev=tcp

31      /dev/dsk/c2b0t5d1s1 /dev/rdsk/c2b0t5d1s1    /home/s21   vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

32      /dev/dsk/c2b0t5d1s2 /dev/rdsk/c2b0t5d1s2    /home/s22   vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

33      /dev/dsk/c2b0t5d1s3 /dev/rdsk/c2b0t5d1s3    /home/s23   vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

34      /dev/dsk/c2b0t5d2s1 /dev/rdsk/c2b0t5d2s1    /home/31    vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

35      /dev/dsk/c2b0t5d2s2 /dev/rdsk/c2b0t5d2s2    /home/32    vxfs    1   no  mincache=closesync  SYS_RANGE_MAX

36      @

37      "/etc/vfstab" 21 lines, 1483 characters

 

我们执行命令diskrm c2b0t5d1后,在/etc/vfsvtab文件中看不到上面1416行所显示的内容,说明删除成功。在执行该命令的过程中显示内容如下所示:

1          # diskrm c2b0t5d1

2          UX:diskrm: INFO: You have invoked the System V disk management (s5dm) diskrm ut.

3          The purpose of this utility is to remove entries from the /etc/vfstab file.

4          Do you wish to continue?

5          (Type y for yes or n for no followed by ENTER):

6          y

7          UX:diskrm: INFO:

8          Do you want to delete the following entry?

 

9          /dev/dsk/c2b0t5d1s1     /dev/rdsk/c2b0t5d1s1    /home/s21       vxfs    1      X

 

10      (Type y for yes or n for no and press ):

11      y

12      UX:diskrm: INFO:

13      Do you want to delete the following entry?

 

14      /dev/dsk/c2b0t5d1s2     /dev/rdsk/c2b0t5d1s2    /home/s22       vxfs    1      X

 

15      (Type y for yes or n for no and press ):

16      y

17      UX:diskrm: INFO:

18      Do you want to delete the following entry?

 

19      /dev/dsk/c2b0t5d1s3     /dev/rdsk/c2b0t5d1s3    /home/s23       vxfs    1      X

 

20      (Type y for yes or n for no and press ):

21      y

22      UX:diskrm: INFO: saving /etc/vfstab to /etc/Ovfstab

23      UX:diskrm: INFO: creating a new /etc/vfstab

24      UX:diskrm: INFO: Diskrm for disk c2b0t5d1 DONE at Thu Feb 26 14:07:46 CST 2004

25      #

附录

参考资料:

1. www,chinaunix.net论坛上的相关文章。

2. UnixWare7.1.17.1.3上的联机手册,包括:prtvtocedvtocvtocfdiskdisksetupdiskadddiskrm等。

阅读(1168) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~