美文网首页
solaris10挂载硬盘

solaris10挂载硬盘

作者: mo371 | 来源:发表于2019-01-26 19:36 被阅读0次
    bash-3.2# mkdir /data1
    
    bash-3.2# format
    Searching for disks...done
    
    
    AVAILABLE DISK SELECTIONS:
           0. c0t0d0 <DEFAULT cyl 36465 alt 2 hd 255 sec 63>
              /pci@0,0/pci8086,3408@1/pci103c,3245@0/sd@0,0
           1. c0t1d0 <DEFAULT cyl 36465 alt 2 hd 255 sec 63>
              /pci@0,0/pci8086,3408@1/pci103c,3245@0/sd@1,0
    Specify disk (enter its number): 1     <===1为新添加的盘,可以查看/etc/vsftab文件
    selecting c0t1d0
    [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程序
                 Total disk size is 36468 cylinders
                 Cylinder size is 16065 (512 byte) blocks
    
                                                   Cylinders
          Partition   Status    Type          Start   End   Length    %
          =========   ======    ============  =====   ===   ======   ===
              1       Active    Solaris2          1  36467    36467    100
    
    
    
    
    
    SELECT ONE OF THE FOLLOWING:
       1. Create a partition
       2. Specify the active partition
       3. Delete a partition
       4. Change between Solaris and Solaris2 Partition IDs
       5. Exit (update disk configuration and exit)
       6. Cancel (exit without updating disk configuration)
    Enter Selection: 5  <==退出fdisk界面
    
    
    format> 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>  label  <==运行label命令,把分区表写入到磁盘中
    Ready to label disk, continue? y
    
    partition> print   <==显示当前分区列表
    Current partition table (original):
    Total disk cylinders available: 36465 + 2 (reserved cylinders)
    
    Part      Tag    Flag     Cylinders         Size            Blocks
      0       root    wm   15175 - 17724       19.53GB    (2550/0/0)   40965750
      1       swap    wu       1 -  8159       62.50GB    (8159/0/0)  131074335
      2     backup    wm       0 - 36464      279.34GB    (36465/0/0) 585810225    <==这个为新添加的盘
      3 unassigned    wm    8800 - 10074        9.77GB    (1275/0/0)   20482875
      4        usr    wm   12625 - 15174       19.53GB    (2550/0/0)   40965750
      5        var    wm   10075 - 12624       19.53GB    (2550/0/0)   40965750
      6 unassigned    wm   17725 - 36464      143.56GB    (18740/0/0) 301058100
      7       home    wm    8162 -  8799        4.89GB    (638/0/0)    10249470
      8       boot    wu       0 -     0        7.84MB    (1/0/0)         16065
      9 unassigned    wm       0                0         (0/0/0)             0
    
    partition> quit
    
    
    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> quit
    
    bash-3.2# newfs /dev/dsk/c0t1d0s2  <==s2对应上面的backup(part为2)
    newfs: construct a new file system /dev/rdsk/c0t1d0s2: (y/n)? y  <==yes确认
    Warning: 1744 sector(s) in last cylinder unallocated
    /dev/rdsk/c0t1d0s2:     585810224 sectors in 95347 cylinders of 48 tracks, 128 sectors
            286040.2MB in 5960 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
    super-block backups (for fsck -F ufs -o b=#) at:
     32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
    Initializing cylinder groups:
    ...............................................................................
    .......................................
    super-block backups for last 10 cylinder groups at:
     584916768, 585015200, 585105440, 585203872, 585302304, 585400736, 585499168,
     585597600, 585696032, 585794464
    
    bash-3.2# mount /dev/dsk/c0t1d0s2 /data1  <==挂载
    bash-3.2# 
    bash-3.2# cd /data1
    bash-3.2# ls
    lost+found
    
    bash-3.2# df -h
    Filesystem             size   used  avail capacity  Mounted on
    /dev/dsk/c0t0d0s0       19G   586M    18G     4%    /
    /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                    89G   936K    89G     1%    /etc/svc/volatile
    objfs                    0K     0K     0K     0%    /system/object
    sharefs                  0K     0K     0K     0%    /etc/dfs/sharetab
    /dev/dsk/c0t0d0s4       19G   5.0G    14G    27%    /usr
    /usr/lib/libc/libc_hwcap1.so.1
                            19G   5.0G    14G    27%    /lib/libc.so.1
    fd                       0K     0K     0K     0%    /dev/fd
    /dev/dsk/c0t0d0s5       19G   426M    19G     3%    /var
    swap                    89G     0K    89G     0%    /tmp
    swap                    89G    16K    89G     1%    /var/run
    /dev/dsk/c0t0d0s6      141G    49G    91G    35%    /data
    /dev/dsk/c0t0d0s3      9.6G   5.7G   3.9G    60%    /opt
    /dev/dsk/c0t0d0s7      4.8G   3.9G   846M    83%    /export/home
    /dev/dsk/c0t1d0s2      275G   256M   272G     1%    /data1   <==新的盘看到了
    
    开机自动挂载:
    bash-3.2# vi /etc/vfstab 
    "/etc/vfstab" 19 lines, 796 characters 
    #device         device          mount           FS      fsck    mount   mount
    #to mount       to fsck         point           type    pass    at boot options
    #
    fd      -       /dev/fd fd      -       no      -
    /proc   -       /proc   proc    -       no      -
    /dev/dsk/c0t0d0s1       -       -       swap    -       no      -
    /dev/dsk/c0t0d0s0       /dev/rdsk/c0t0d0s0      /       ufs     1       no      -
    /dev/dsk/c0t0d0s4       /dev/rdsk/c0t0d0s4      /usr    ufs     1       no      -
    /dev/dsk/c0t0d0s5       /dev/rdsk/c0t0d0s5      /var    ufs     1       no      -
    /dev/dsk/c0t0d0s6       /dev/rdsk/c0t0d0s6      /data   ufs     2       yes     -
    /dev/dsk/c0t0d0s7       /dev/rdsk/c0t0d0s7      /export/home    ufs     2       yes     -
    /dev/dsk/c0t0d0s3       /dev/rdsk/c0t0d0s3      /opt    ufs     2       yes     -
    /dev/dsk/c0t1d0s2       /dev/rdsk/c0t1d0s2      /data1  ufs     2       yes     -     <==这行是新添加的,按着之前的照猫画虎
    #/dev/dsk/c0t1d0s0      /dev/rdsk/c0t1d0s0      /data1  ufs     2       yes     -
    #/dev/dsk/c0t2d0s0      /dev/rdsk/c0t2d0s0      /data2  ufs     2       yes     -
    /devices        -       /devices        devfs   -       no      -
    sharefs -       /etc/dfs/sharetab       sharefs -       no      -
    ctfs    -       /system/contract        ctfs    -       no      -
    objfs   -       /system/object  objfs   -       no      -
    swap    -       /tmp    tmpfs   -       yes     -
    
    

    相关文章

      网友评论

          本文标题:solaris10挂载硬盘

          本文链接:https://www.haomeiwen.com/subject/wxcidqtx.html