Tuesday, December 20, 2011

Map san xuống server solaris sử dụng UFS

-- Kiểm tra ổ dĩa hiện tại
root@c4is-standby-s # echo |format

AVAILABLE DISK SELECTIONS:
       0. c1t0d0
          /pci@1f,700000/scsi@2/sd@0,0
       1. c1t1d0
          /pci@1f,700000/scsi@2/sd@1,0
       2. c1t2d0
          /pci@1f,700000/scsi@2/sd@2,0
       3. c1t3d0
          /pci@1f,700000/scsi@2/sd@3,0
       4. c5t600A0B8000330D0A0000054748BF696Bd0
          /scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
       5. c5t600A0B80004700CE0000057348BF6846d0
          /scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
       6. c5t600A0B80004700CE0000057748BF6AD0d0
          /scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0
Specify disk (enter its number): Specify disk (enter its number):

-- Vào SAN tạo volumn sau đó map xuống host
--Sau khi map xuống xong kiểm tra ổ đĩa mới 

root@c4is-standby-s # echo |format

AVAILABLE DISK SELECTIONS:
       0. c1t0d0
          /pci@1f,700000/scsi@2/sd@0,0
       1. c1t1d0
          /pci@1f,700000/scsi@2/sd@1,0
       2. c1t2d0
          /pci@1f,700000/scsi@2/sd@2,0
       3. c1t3d0
          /pci@1f,700000/scsi@2/sd@3,0
       4. c5t600A0B8000330D0A0000054748BF696Bd0
          /scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
       5. c5t600A0B80004700CE00001D8C4EF0CD9Cd0
          /scsi_vhci/ssd@g600a0b80004700ce00001d8c4ef0cd9c
       6. c5t600A0B80004700CE0000057348BF6846d0
          /scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
       7. c5t600A0B80004700CE0000057748BF6AD0d0
          /scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0
Specify disk (enter its number): Specify disk (enter its number):

-- Ổ đĩa hiện tại đc map xuống là
 5. c5t600A0B80004700CE00001D8C4EF0CD9Cd0


-- Xác định lại silde của partition cần format để chọn  newfs

root@c4is-standby-s # format
Searching for disks...done

c5t600A0B80004700CE00001D8C4EF0CD9Cd0: configured with capacity of 1024.00GB


AVAILABLE DISK SELECTIONS:
       0. c1t0d0
          /pci@1f,700000/scsi@2/sd@0,0
       1. c1t1d0
          /pci@1f,700000/scsi@2/sd@1,0
       2. c1t2d0
          /pci@1f,700000/scsi@2/sd@2,0
       3. c1t3d0
          /pci@1f,700000/scsi@2/sd@3,0
       4. c5t600A0B8000330D0A0000054748BF696Bd0
          /scsi_vhci/ssd@g600a0b8000330d0a0000054748bf696b
       5. c5t600A0B80004700CE00001D8C4EF0CD9Cd0
          /scsi_vhci/ssd@g600a0b80004700ce00001d8c4ef0cd9c
       6. c5t600A0B80004700CE0000057348BF6846d0
          /scsi_vhci/ssd@g600a0b80004700ce0000057348bf6846
       7. c5t600A0B80004700CE0000057748BF6AD0d0
          /scsi_vhci/ssd@g600a0b80004700ce0000057748bf6ad0

--- chọn ổ đĩa mới thứ 5 mới gắn vào

Specify disk (enter its number): 5
selecting c5t600A0B80004700CE00001D8C4EF0CD9Cd0
[disk formatted]
Disk not labeled.  Label it now? yes


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
        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
        inquiry    - show vendor, product and revision
        volname    - set 8-character volume name
        !     - execute , then return
        quit
format> p


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
        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> p
Current partition table (original):
Total disk sectors available: 2147467230 + 16384 (reserved sectors)

Part      Tag    Flag     First Sector          Size          Last Sector
  0       root    wm                34       128.00MB           262177   
  1       swap    wu            262178       128.00MB           524321   
  2 unassigned    wu                 0            0                0   
  3 unassigned    wm                 0            0                0   
  4 unassigned    wm                 0            0                0   
  5 unassigned    wm                 0            0                0   
  6        usr    wm            524322      1023.74GB           2147467229   
  8   reserved    wm        2147467230         8.00MB           2147483613   

partition> q


==> chú ý thấy vị trí thứ 6 dung lượng là 1G  => chính là s6
 

Tạo newfs

newfs /dev/rdsk/c5t600A0B80004700CE00001D8C4EF0CD9Cd0s6
 


-- Tạo một thư mục tên u04, sao đó mount vào
mount -F ufs /dev/dsk/c5t600A0B80004700CE00001D8C4EF0CD9Cd0s6 /u04

Chú ý: thay thế rdsk bằng dsk


=====================
Lệnh để clean cache device 

devfsadm -Cv

0 comments: