본문 바로가기
os/Solaris

[실습] 파티션, 포맷, 마운트

by #moonyz 2014. 8. 29.
** HDD추가후 touch /reconfigure 생성후 리부팅 --하드인식

** 파티션 나누기

bash-2.05# format

Searching for disks...done

           AVAILABLE DISK SELECTIONS:

           0. c0d0 <DEFAULT cyl 22189 alt 2 hd 15 sec 63>/pci@0,0/pci-ide@7,1/ide@0/cmdk@0,0

           1. c0d1 <DEFAULT cyl 2077 alt 2 hd 16 sec 63>/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> 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> 1

Part      Tag    Flag     Cylinders        Size            Blocks

1 unassigned    wm       0               0         (0/0/0)          0


Enter partition id tag[unassigned]:

Enter partition permission flags[wm]:

Enter new starting cyl[0]: 813 --Cylinders

Enter partition size[0b, 0c, 813e, 0.00mb, 0.00gb]: $  -- $나머지

partition> print

Current partition table (unnamed):

Total disk cylinders available: 2077 + 2 (reserved cylinders)


Part      Tag    Flag     Cylinders        Size            Blocks

0 unassigned    wm       0 -  812      400.15MB    (813/0/0)   819504

1 unassigned    wm     813 - 2076      622.12MB    (1264/0/0) 1274112

2     backup    wu       0 - 2077     1022.77MB    (2078/0/0) 2094624

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        0.49MB    (1/0/0)       1008

9 alternates    wm       1 -    2        0.98MB    (2/0/0)       2016


partition> label -- VTOC에 저장

Ready to label disk, continue? y


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

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


bash-2.05# prtvtoc /dev/dsk/c0d0s0 --슬라이스 된 HDD 정보 확인

* /dev/dsk/c0d0s0 partition map

*

* Dimensions:

*     512 bytes/sector

*      63 sectors/track

*      15 tracks/cylinder

*     945 sectors/cylinder

*   22191 cylinders

*   22189 accessible cylinders

*

* Flags:

*   1: unmountable

*  10: read-only

*

*                          First     Sector    Last

* Partition  Tag  Flags    Sector     Count    Sector  Mount Directory

0      2    00       2835  10240020  10242854   /

1      7    00   10242855   2048760  12291614   /var

2      5    00          0  20968605  20968604

3      8    00   12291615   8676990  20968604   /export/home

8      1    01          0       945       944

9      9    01        945      1890      2834

bash-2.05#


** 포맷하기 (*newfs 사용)

bash-2.05# newfs /dev/rdsk/c0d1s0

newfs: construct a new file system /dev/rdsk/c0d1s0: (y/n)? y

/dev/rdsk/c0d1s0:       819504 sectors in 813 cylinders of 16 tracks, 63 sectors

400.1MB in 51 cyl groups (16 c/g, 7.88MB/g, 3776 i/g)

super-block backups (for fsck -F ufs -o b=#) at:

32, 16224, 32416, 48608, 64800, 80992, 97184, 113376, 129568, 145760,

661856, 678048, 694240, 710432, 726624, 742816, 759008, 774176, 790368,

806560,

bash-2.05# newfs /dev/rdsk/c0d1s1

newfs: construct a new file system /dev/rdsk/c0d1s1: (y/n)? y

/dev/rdsk/c0d1s1:       1274112 sectors in 1264 cylinders of 16 tracks, 63 sectors

622.1MB in 79 cyl groups (16 c/g, 7.88MB/g, 3776 i/g)

super-block backups (for fsck -F ufs -o b=#) at:

32, 16224, 32416, 48608, 64800, 80992, 97184, 113376, 129568, 145760,

1113184, 1129376, 1145568, 1161760, 1177952, 1194144, 1210336, 1226528,

1242720, 1258912,



** 디렉토리 만들어서 마운트 하기

bash-2.05# mkdir /p1

bash-2.05# mkdir /p2

bash-2.05# mount /dev/dsk/c0d1s0  /p1

bash-2.05# mount /dev/dsk/c0d1s1  /p2

bash-2.05# df -h

Filesystem             size   used  avail capacity  Mounted on

/dev/dsk/c0d0s0        4.8G   1.4G   3.3G    31%    /

/proc                    0K     0K     0K     0%    /proc

mnttab                   0K     0K     0K     0%    /etc/mnttab

fd                       0K     0K     0K     0%    /dev/fd

/dev/dsk/c0d0s1        939M    30M   852M     4%    /var

swap                   808M    20K   808M     1%    /var/run

swap                   808M     4K   808M     1%    /tmp

/dev/dsk/c0d0s3        4.1G   4.2M   4.0G     1%    /export/home

/vol/dev/dsk/c1t0d0/20040114_000414

6.1M   6.1M     0K   100%    /cdrom/20040114_000414

/dev/dsk/c0d1s0        376M   1.0M   337M     1%    /p1

/dev/dsk/c0d1s1        584M   1.0M   525M     1%    /p2


bash-2.05# umount /p2

bash-2.05# df -h

Filesystem             size   used  avail capacity  Mounted on

/dev/dsk/c0d0s0        4.8G   1.4G   3.3G    31%    /

/proc                    0K     0K     0K     0%    /proc

mnttab                   0K     0K     0K     0%    /etc/mnttab

fd                       0K     0K     0K     0%    /dev/fd

/dev/dsk/c0d0s1        939M    30M   852M     4%    /var

swap                   808M    20K   808M     1%    /var/run

swap                   808M     4K   808M     1%    /tmp

/dev/dsk/c0d0s3        4.1G   4.2M   4.0G     1%    /export/home

/vol/dev/dsk/c1t0d0/20040114_000414

6.1M   6.1M     0K   100%    /cdrom/20040114_000414

/dev/dsk/c0d1s0        376M   1.0M   337M     1%    /p1

bash-2.05#

bash-2.05#


** 마운트 테스트 하기

bash-2.05# touch /p1/a.txt

bash-2.05# ls /p1

a.txt       lost+found

bash-2.05# umount /p1

bash-2.05# mount /dev/dsk/c0d1s0  /p2

bash-2.05#

bash-2.05# ls /p2

a.txt       lost+found

bash-2.05# touch /p1/b.txt

bash-2.05#

bash-2.05# umount /p2

bash-2.05# mount /dev/dsk/c0d1s0 /p1

bash-2.05# ls /p1

a.txt       lost+found


'os > Solaris' 카테고리의 다른 글

[실습] NFS (서버, 클라이언트)  (0) 2014.08.29
[실습] NFS를 활용한 백업서버 구현  (0) 2014.08.29
22. NFS (Network File System)  (0) 2014.08.29
21. 가상파일시스템 (Pseudo)  (0) 2014.08.29
20. patch  (0) 2014.08.29

댓글