solaris 10 在 vmware 虚拟机中新增磁盘!

1、把磁盘插到主机上面,重启系统,可是看不见相应的磁盘啊!下面是一个分区的例子:
-bash-3.00# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <DEFAULT cyl 3913 alt 2 hd 255 sec 63>     #我在主机上面插了两块磁盘,可是现在还是只有原来的一块。
          /pci@0,0/pci15ad,1976@10/sd@0,0
Specify disk (enter its number): ^C
-bash-3.00# devfsadm                                        #系统检测新增加的设备。
-bash-3.00# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <DEFAULT cyl 3913 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c1t1d0 <DEFAULT cyl 1042 alt 2 hd 255 sec 63>     #这次可以看见对上了。
          /pci@0,0/pci15ad,1976@10/sd@1,0
       2. c1t2d0 <DEFAULT cyl 1042 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@2,0
Specify disk (enter its number): ^C
-bash-3.00# df -h
文件系统               大小   用了   可用 容量      挂接在
/dev/dsk/c1t0d0s0       26G   6.1G    19G    25%    /                      #对于每个一磁盘分片,通常以c*t*d*s*表示,其中c/t/d/s的含义如下:
/devices                 0K     0K     0K     0%    /devices               #C代表控制器标号。控制器位于主板上面,所谓控制器,就是控制,发出命令的器件。
ctfs                     0K     0K     0K     0%    /system/contract       #T代表目标编号。 即分配给每个存储设备的一个唯一的硬件地址。
proc                     0K     0K     0K     0%    /proc                  #D代表磁盘编号。 这个数字反映的是目标位置上的磁盘号,即具体的磁盘。
mnttab                   0K     0K     0K     0%    /etc/mnttab            #S代表分片编号。 通常从0~7,即分区的号码了。
swap                   3.6G   612K   3.6G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
/usr/lib/libc/libc_hwcap1.so.1
                        26G   6.1G    19G    25%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   3.6G     0K   3.6G     0%    /tmp
swap                   3.6G    20K   3.6G     1%    /var/run
-bash-3.00# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <DEFAULT cyl 3913 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@0,0
       1. c1t1d0 <DEFAULT cyl 1042 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@1,0
       2. c1t2d0 <DEFAULT cyl 1042 alt 2 hd 255 sec 63>
          /pci@0,0/pci15ad,1976@10/sd@2,0
Specify disk (enter its number): 1                          #选择新增加的硬盘
selecting c1t1d0
[disk formatted]


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> fdisk                                                #建立分区表,新磁盘必须先fdisk。
No fdisk table exists. The default partition for the disk is:

  a 100% "SOLARIS System" partition

Type "y" to accept the default partition,  otherwise type "n" to edit the
 partition table.
y                                                          #这里输入Y
format> label                                              #这个label标签相当于对前面所做的操作的一个生效操作。
Ready to label disk, continue? y

format> p                                                  #p等于partition命令,进入分区状态


PARTITION MENU:
        0      - change `0' partition
        1      - change `1' partition
        2      - change `2' partition
        3      - change `3' partition
        4      - change `4' partition
        5      - change `5' partition
        6      - change `6' partition
        7      - change `7' partition
        select - select a predefined table
        modify - modify a predefined partition table
        name   - name the current table
        print  - display the current table
        label  - write partition map and label to the disk
        !<cmd> - execute <cmd>, then return
        quit
partition> print                   #显示当前分区表
Current partition table (original):
Total disk cylinders available: 1041 + 2 (reserved cylinders)

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 - 1041        7.98GB    (1042/0/0) 16739730      #可以看见这个磁盘有8g
  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       0               0         (0/0/0)           0
  8       boot    wu       0 -    0        7.84MB    (1/0/0)       16065
  9 unassigned    wm       0               0         (0/0/0)           0

partition> 0                                                                 #选择0分区
Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0               0         (0/0/0)           0

Enter partition id tag[unassigned]: unassigned          #输入分区ID标签
Enter partition permission flags[wm]: wm                #输入分区权限参数
Enter new starting cyl[0]: 0                            #输入分区起始柱面为0柱面
Enter partition size[0b, 0c, 0e, 0.00mb, 0.00gb]: 1gb   #输入分区大小
partition> label                                        #将信息写入磁盘中,这里也相当于对前面的分区的生效。
Ready to label disk, continue? yes

partition> print
Current partition table (unnamed):
Total disk cylinders available: 1041 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0 unassigned    wm       0 -  130        1.00GB    (131/0/0)   2104515
  1 unassigned    wm       0               0         (0/0/0)           0
  2     backup    wu       0 - 1041        7.98GB    (1042/0/0) 16739730
  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       0               0         (0/0/0)           0
  8       boot    wu       0 -    0        7.84MB    (1/0/0)       16065
  9 unassigned    wm       0               0         (0/0/0)           0

partition> q               #退出


FORMAT MENU:
        disk       - select a disk
        type       - select (define) a disk type
        partition  - select (define) a partition table
        current    - describe the current disk
        format     - format and analyze the disk
        fdisk      - run the fdisk program
        repair     - repair a defective sector
        label      - write label to the disk
        analyze    - surface analysis
        defect     - defect list management
        backup     - search for backup labels
        verify     - read and display labels
        save       - save new disk/partition definitions
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit
format> q                #退出
-bash-3.00# newfs /dev/rdsk/c1t1d0s0                       #建立新的文件系统
newfs: 建构新的文件系统 /dev/rdsk/c1t1d0s0: (y/n)? y
警告:最后一个未分配柱面中的 12286 扇区
/dev/rdsk/c1t1d0s0:     在 140 磁道上,240 扇区的 63 柱面的 2104514 扇区
        1027.6MB 在 24 柱面群组 (6 c/g, 44.30MB/g, 10688 i/g)
超块 (fsck -F ufs -o b=#) 备份在:
 32, 90816, 181600, 272384, 363168, 453952, 544736, 635520, 726304, 817088,
 1271008, 1361792, 1452576, 1543360, 1634144, 1724928, 1815712, 1906496,
 1997280, 2088064,
-bash-3.00# mkdir /mnt/c1t1d0s0                            #建立挂载点
-bash-3.00# mount /dev/dsk/c1t1d0s0 /mnt/c1t1d0s0
-bash-3.00# df -h
文件系统               大小   用了   可用 容量      挂接在
/dev/dsk/c1t0d0s0       26G   6.1G    19G    25%    /
/devices                 0K     0K     0K     0%    /devices
ctfs                     0K     0K     0K     0%    /system/contract
proc                     0K     0K     0K     0%    /proc
mnttab                   0K     0K     0K     0%    /etc/mnttab
swap                   3.6G   608K   3.6G     1%    /etc/svc/volatile
objfs                    0K     0K     0K     0%    /system/object
/usr/lib/libc/libc_hwcap1.so.1
                        26G   6.1G    19G    25%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                   3.6G     0K   3.6G     0%    /tmp
swap                   3.6G    20K   3.6G     1%    /var/run
/dev/dsk/c1t1d0s0      996M   1.0M   935M     1%    /mnt/c1t1d0s0

2、/dev/dsk和/dev/rdsk到底有什么区别?
答:磁盘设备文件同时存在于 /dev/dsk 和 /dev/rdsk 两个目录下,这两个目录分别对应 块设备 和 原始设备 入口。
一个是建立了文件系统的。一个是没有建文件系统的裸设备。mount就用/dev/dsk,newfs就用/dev/rdsk。

3、format 菜单详解:
FORMAT MENU:
        disk       - select a disk                        #允许在 format 实用程序中更改磁盘。
        type       - select (define) a disk type          #现在已经很少有人使用 type 选项了,过去经常使用该选项因为当时磁盘并非始终包含有关其自身的信息。
        partition  - select (define) a partition table    #选择该选项时将启动 Partition Menu(分区菜单),我们可以从中修改磁盘上的分区。
        current    - describe the current disk            #显示在启动 format 命令后选择的当前磁盘。
        format     - format and analyze the disk          #进行 Solaris 操作系统的安装准备。
        fdisk      - run the fdisk program                #建立分区表。
        repair     - repair a defective sector            #修复磁盘上有缺陷的块(可能会成功,也可能不会)。
        label      - write label to the disk              #标签。
        analyze    - surface analysis                     #可以使用 Analyze Menu(分析菜单)上的项来分析磁盘。
        defect     - defect list management               #打开 Defect Menu(缺陷菜单),该菜单用于查看磁盘出厂时的缺陷数目。
        backup     - search for backup labels             #backup 选项将搜索备份标签。
        verify     - read and display labels              #显示的很多信息,并且使用 format 命令显示分区时也会显示这些信息。
        save       - save new disk/partition definitions  #将信息写出到一个 format.dat 文件(或指定的任意名称)中。
        inquiry    - show vendor, product and revision    #收集磁盘相关信息的选项,它显示一些非常基本的信息。
        volname    - set 8-character volume name                    #为每个磁盘指定卷名称,可以帮助识别已使用的磁盘。没有卷名称的磁盘是未使用的磁盘。
        !<cmd>     - execute <cmd>, then return           #切换到命令行。
          quit                                              #退出。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值