fdisk
개요
파일을 확인 한후 파티션 잡고 확장 자로 포맷 한다음에 마운트 하면 된다.
하지만 물리 볼률-> 가상 볼륨 -> 논리 볼륨 의 추상화를 통해
물리 볼룸에 계속 물리 볼륨을 추가해서 사용할수 있다.
아래의 절차는
- 확인
- 파티션잡기
- 물리볼륨 생성
- 가상볼륨 생성
- 논리볼륨 생성
- 논리볼륨 파일 확장자 포맷
- 마운트 의 단계를 거친다.
- 확인
- fdisk -l
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006057d
#
Device Boot Start End Blocks Id System
/dev/xvda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2 64 2611 20458496 8e Linux LVM
#
Disk /dev/xvdb: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
#
#
Disk /dev/mapper/VolGroup-lv_root: 18.8 GB, 18832424960 bytes
255 heads, 63 sectors/track, 2289 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
#
#
Disk /dev/mapper/VolGroup-lv_swap: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
- df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
18G 1.2G 16G 7% /
tmpfs 935M 0 935M 0% /dev/shm
/dev/xvda1 485M 73M 387M 16% /boot
위 두개를 비교해서 df 에 잡이지 않는 장치를 찾아낸후
- fdisk /dev/xvdf
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x444e3a3a.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.
.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
.
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
- 파티션잡기
이제 파티션을 잡는다.
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
- p
파티션 확인
- n
새로운 파티션 추가
- e 또는 p 에서 P선택(새로운 파티션 추가) -> 1 -> enter
- t
8e
w
설정한 파티션 쓰고 나가기
파티션 확인하기
fdisk -l
Disk /dev/xvda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006057d
.
Device Boot Start End Blocks Id System
/dev/xvda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/xvda2 64 2611 20458496 8e Linux LVM
.
Disk /dev/xvdb: 85.9 GB, 85899345920 bytes
255 heads, 63 sectors/track, 10443 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x4b5201f9
.
Device Boot Start End Blocks Id System
/dev/xvdb1 1 10443 83883366 8e Linux LVM
.
Disk /dev/mapper/VolGroup-lv_root: 18.8 GB, 18832424960 bytes
255 heads, 63 sectors/track, 2289 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
.
.
Disk /dev/mapper/VolGroup-lv_swap: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
- 물리 볼륨
- PV 생성
pvcreate /dev/xvdb1
pvscan
- 가상 볼륨
- VG 생성: 이름을 VolGroup으로 블락 사이즈를 지정 할수 있다 -s 16 (기본은 4M)
vgcreate VolGroup2 /dev/xvdb1
vgdisplay로 확인가능
- vgextend vg1 /dev/sdf1 로 하면 확장가
- 논리 볼륨
- LV 생성
lvdisplay
lvcreate -L 79g -n data00 VolGroup2
#lvextend -L+500g /dev/VolGroup2/data00
- 포맷
- 파일시스템 생성
mkfs.ext4 /dev/VolGroup2/data00
- 마운트
마운트
mkdir /data
mount /dev/VolGroup2/data00 /data
언마운트로 없앨수 있음
- fstab에 추가
0 - 무결성 검사를 하지 않습니다.
1 - 우선순위 1위를 뜻하며, 대부분 루트부분에 설정을 해놓습니다.
2 - 우선순위 2위를 뜻하며, 1위를 검사한후 2위를 검사합니다.
대부북 루트부분이 1이기때문에 루트부분 검사후 검사합니다.
```
좀전에 정의한 드라이버 마운트 시키고
추가후 mount -a 로 전부 마운트 시키고 df -h 로 확인가능