Solaris 10 x86系统上添加新硬盘过程

系统环境:
       在VMware 7.13虚拟机软件上安装32位的Solaris 10 x86操作系统。系统分配硬盘15G,内存1G。现通过虚拟机向Solaris系统上增加一块8G的硬盘。

过程:

 

# touch /reconfigure 

# init 0

 

 注:只有先执行touch /reconfigure后再关闭电脑,启动时系统才会监测硬件变动

 

 


1.       识别新增硬盘
# format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
       0. c0d0
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
Specify disk (enter its number): ^C

# devfsadm
# format
Searching for disks...done

AVAILABLE DISK SELECTIONS:
       0. c0d0
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
       1. c0d1
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
Specify disk (enter its number): 1

注意:两次format命令显示内容的区别。第二次系统识别出新增硬盘c0d1。
在此次试验中使用命令 devfsadm命令识别出新增硬盘,网络上还有一些其他方法。

2.       格式化新增硬盘
# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c0d0 <DEFAULT cyl 1955 alt 2 hd 255 sec 63>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0
       1. c0d1 <DEFAULT cyl 4093 alt 2 hd 128 sec 32>
          /pci@0,0/pci-ide@7,1/ide@0/cmdk@1,0
Specify disk (enter its number): 1                           注释:选择新增加的硬盘
selecting c0d1
Controller working list found
[disk formatted, defect list found]


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
        show       - translate a disk address
        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
        volname    - set 8-character volume name
        !<cmd>     - execute <cmd>, then return
        quit

format> 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

format> 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
        ! - execute , then return
        quit                              

 

partition> print                                     注释:显示当前分区表
Current partition table (original):
Total disk cylinders available: 4092 + 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 - 4091    7.99GB    (4092/0/0) 16760832
  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       2.00MB    (1/0/0)               4096
  9   alternates    wm       1 -    2       4.00MB    (2/0/0)               8192

 


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]:  7.99gb         注释:输入分区大小,6GB

partition>  label                                                                         注释:将信息写入磁盘中
Ready to label disk, continue?  y

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

Part          Tag     Flag     Cylinders        Size                    Blocks
  0 unassigned    wm       0 - 4090        7.99GB      (4091/0/0) 16756736
  1 unassigned    wm       0                    0              (0/0/0)                     0
  2        backup    wu        0 - 4091        7.99GB     (4092/0/0) 16760832
  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           2.00MB     (1/0/0)               4096
  9   alternates    wm       1 -    2           4.00MB     (2/0/0)               8192
 

 

 


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
        show       - translate a disk address
        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
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format>  q                                                                            &szlig; 注释:退出

3.       建立新的文件系统
# newfs /dev/rdsk/c0d1s0
newfs: 建构新的文件系统 /dev/rdsk/c0d1s0: (y/n)? y
警告:最后一个未分配柱面中的 4096 扇区
/dev/rdsk/c0d1s0:       在 2728 磁道上,48 扇区的 128 柱面的 16756736 扇区
        8182.0MB 在 171 柱面群组 (16 c/g, 48.00MB/g, 5824 i/g)
超块 (fsck -F ufs -o b=#) 备份在:
 32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
 15831200, 15929632, 16028064, 16126496, 16224928, 16323360, 16421792,
 16520224, 16618656, 16717088

 


4.       建立挂载点
# mkdir /oracle
# mount /dev/dsk/c0d1s0 /oracle
# df -h
文件系统               大小   用了   可用 容量      挂接在
/dev/dsk/c0d0s0        8.6G   4.6G    3.9G    55%    /
/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                       814M   988K   813M      1%    /etc/svc/volatile
objfs                            0K       0K       0K      0%    /system/object
sharefs                        0K       0K       0K      0%    /etc/dfs/sharetab
/usr/lib/libc/libc_hwcap1.so.1
                                8.6G   4.6G    3.9G    55%    /lib/libc.so.1
fd                                0K      0K       0K      0%    /dev/fd
swap                      813M    84K   813M     1%    /tmp
swap                      813M    40K   813M     1%    /var/run
/dev/dsk/c0d0s7     5.7G   5.8M    5.6G     1%    /export/home
/hgfs                        16G   4.0M     16G     1%    /hgfs
/tmp/VMwareDnD       0K      0K       0K     0%    /var/run/vmblock
/dev/dsk/c0d1s0     7.9G   8.0M   7.8G     1%    /oracle

 

 

 

如果不想每次开机都手动挂载,可以将该硬盘设置为自动挂载:

#cd /etc  

#vi vfstab

将下面命令加到vfstab文件,则开机时添加的硬盘会自动挂载到你指定的目录(这里是/oracle)

/dev/dsk/c0d1s0   /dev/rdsk/c0d1s0   /oracle   ufs   2   yes   -

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值