centos2[root /root]# ls sdc sdd
ls: sdc: 그런 파일이나 디렉토리가 없음
ls: sdd: 그런 파일이나 디렉토리가 없음
centos2[root /root]# cd /dev
centos2[root /dev]# fdisk /dev/sdc
Command (m for help): p
Disk /dev/sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 96 98288 83 Linux
/dev/sdc2 97 192 98304 83 Linux
/dev/sdc3 193 288 98304 83 Linux
/dev/sdc4 289 512 229376 83 Linux
Command (m for help):
centos2[root /dev]# fdisk /dev/sdc
Command (m for help): m
Command action
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)
Command (m for help): n
You must delete some partition and add an extended partition first
Command (m for help): d
Partition number (1-4): 4
Command (m for help): 3
3: unknown command
Command action
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)
Command (m for help): d
Partition number (1-4): 3
Command (m for help): d
Partition number (1-4): 2
Command (m for help): d1
Selected partition 1
Command (m for help): d
No partition is defined yet!
Command (m for help): 1
1: unknown command
Command action
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)
Command (m for help): p
Disk /dev/sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-512, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-512, default 512):
Using default value 512
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
centos2[root /dev]# fdisk /dev/sdd
Command (m for help): p
Disk /dev/sdd: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): p
Partition number (1-4): 1
First cylinder (1-512, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-512, default 512):
Using default value 512
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
centos2[root /dev]# ls sdc sdd
sdc sdd
centos2[root /dev]# fdisk /dev/sdc
Command (m for help): d
Selected partition 1
Command (m for help): p
Disk /dev/sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
Command (m for help):
centos2[root /dev]# fdisk /dev/sdc
Command (m for help): p
Disk /dev/sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 512 524272 83 Linux
Command (m for help): d
Selected partition 1
Command (m for help): t
No partition is defined yet!
Command (m for help): t
No partition is defined yet!
Command (m for help): p
Disk /dev/sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
Command (m for help): t
No partition is defined yet!
Command (m for help): m
Command action
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)
Command (m for help): p
Disk /dev/sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
Command (m for help):
centos2[root /dev]# fdisk /dev/sdc
Command (m for help): p
Disk /dev/sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 512 524272 83 Linux
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): wp
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
centos2[root /dev]# fdisk /dev/sdc
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Command (m for help): p
Disk /dev/sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdc1 1 512 524272 8e Linux LVM
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
centos2[root /dev]# fdisk /dev/sdd
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): p
Disk /dev/sdd: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
/dev/sdd1 1 512 524272 8e Linux LVM
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
centos2[root /dev]#
centos2[root /dev]# pvcreate /dev/sdc1
Writing physical volume data to disk "/dev/sdc1"
Physical volume "/dev/sdc1" successfully created
centos2[root /dev]# pvcreate /dev/sdd1
Writing physical volume data to disk "/dev/sdd1"
Physical volume "/dev/sdd1" successfully created
centos2[root /dev]#
centos2[root /dev]#
centos2[root /dev]# pv
-bash: pv: command not found
centos2[root /dev]# pv
pv.sh pvck pvdisplay pvremove pvs
pvchange pvcreate pvmove pvresize pvscan
centos2[root /dev]# pvdisplay
"/dev/sdc1" is a new physical volume of "511.98 MB"
--- NEW Physical volume ---
PV Name /dev/sdc1
VG Name
PV Size 511.98 MB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID upKip1-1HC4-unLS-nGwJ-0OEp-Mhzo-oI5uMK
"/dev/sdd1" is a new physical volume of "511.98 MB"
--- NEW Physical volume ---
PV Name /dev/sdd1
VG Name
PV Size 511.98 MB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID YkyQ8Z-TJyN-EZ22-Uni8-yT8S-QOa9-XJKqNq
centos2[root /dev]# vgcreate test_vg /dev/sdc1 /dev/sdd1
Volume group "test_vg" successfully created
centos2[root /dev]# volume group 묶었다.
centos2[root /dev]# vgdisplay
--- Volume group ---
VG Name test_vg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 1016.00 MB
PE Size 4.00 MB
Total PE 254
Alloc PE / Size 0 / 0
Free PE / Size 254 / 1016.00 MB
VG UUID aoLldA-1I6c-1aGc-B5Hx-FcZm-G2V5-GossVy
centos2[root /dev]#
centos2[root /dev]#
centos2[root /dev]#
centos2[root /dev]# lvcreate -L 798M -n test_lg1 test_vg
Rounding up size to full physical extent 800.00 MB
Logical volume "test_lg1" created
centos2[root /dev]# 800M가 된 이유는 LE:199 + 1/2 LE 4의 배
centos2[root /dev]# lvdisplay
--- Logical volume ---
LV Name /dev/test_vg/test_lg1
VG Name test_vg
LV UUID hJFHkS-rYS7-zaDJ-8AU7-oEuM-Xw3g-Z1Dmpx
LV Write Access read/write
LV Status available
# open 0
LV Size 800.00 MB
Current LE 200
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
centos2[root /dev]# lvdisplay | grep -i free
centos2[root /dev]# vgdisplay | grep -i free
Free PE / Size 54 / 216.00 MB
centos2[root /dev]# lvcreate -L 216M -n test_lg2 test_vg
Logical volume "test_lg2" created
centos2[root /dev]# vgdisplay
--- Volume group ---
VG Name test_vg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 1016.00 MB
PE Size 4.00 MB
Total PE 254
Alloc PE / Size 254 / 1016.00 MB
Free PE / Size 0 / 0
VG UUID aoLldA-1I6c-1aGc-B5Hx-FcZm-G2V5-GossVy
centos2[root /dev]# lvdisplay
--- Logical volume ---
LV Name /dev/test_vg/test_lg1
VG Name test_vg
LV UUID hJFHkS-rYS7-zaDJ-8AU7-oEuM-Xw3g-Z1Dmpx
LV Write Access read/write
LV Status available
# open 0
LV Size 800.00 MB
Current LE 200
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Name /dev/test_vg/test_lg2
VG Name test_vg
LV UUID O39b3Y-LUr2-uL4q-7uyv-iHpo-tPev-N1VgJJ
LV Write Access read/write
LV Status available
# open 0
LV Size 216.00 MB
Current LE 54
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
centos2[root /dev]# vgdisplay -v
Finding all volume groups
Finding volume group "test_vg"
--- Volume group ---
VG Name test_vg
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 1016.00 MB
PE Size 4.00 MB
Total PE 254
Alloc PE / Size 254 / 1016.00 MB
Free PE / Size 0 / 0
VG UUID aoLldA-1I6c-1aGc-B5Hx-FcZm-G2V5-GossVy
--- Logical volume ---
LV Name /dev/test_vg/test_lg1
VG Name test_vg
LV UUID hJFHkS-rYS7-zaDJ-8AU7-oEuM-Xw3g-Z1Dmpx
LV Write Access read/write
LV Status available
# open 0
LV Size 800.00 MB
Current LE 200
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Name /dev/test_vg/test_lg2
VG Name test_vg
LV UUID O39b3Y-LUr2-uL4q-7uyv-iHpo-tPev-N1VgJJ
LV Write Access read/write
LV Status available
# open 0
LV Size 216.00 MB
Current LE 54
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
--- Physical volumes ---
PV Name /dev/sdc1
PV UUID upKip1-1HC4-unLS-nGwJ-0OEp-Mhzo-oI5uMK
PV Status allocatable
Total PE / Free PE 127 / 0
PV Name /dev/sdd1
PV UUID YkyQ8Z-TJyN-EZ22-Uni8-yT8S-QOa9-XJKqNq
PV Status allocatable
Total PE / Free PE 127 / 0
centos2[root /dev]#
centos2[root /dev]#
centos2[root /dev]# mkfs -f ext3 /dev/sdc1
mkfs.ext2: invalid fragment size - ext3
centos2[root /dev]# 포멧이 안된다.
centos2[root /dev]# mkfs -t ext3 /dev/test_vg/test_lg1
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
102592 inodes, 204800 blocks
10240 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=209715200
7 block groups
32768 blocks per group, 32768 fragments per group
14656 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 32 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
centos2[root /dev]#
centos2[root /dev]# mkdir /newhome
centos2[root /dev]# mount -t ext3 /dev/test_vg/test_lg1 /newhome
centos2[root /dev]# df -h | tail -2
/dev/mapper/test_vg-test_lg1
788M 17M 731M 3% /newhome
centos2[root /dev]# df -h | grep home
/dev/sdb1 494M 471M 0 100% /home
788M 17M 731M 3% /newhome
centos2[root /dev]# cp -rp /home/* /newhome
centos2[root /dev]#
centos2[root /dev]# rm -rf/home/*
rm: 부적절한 옵션 -- /
더 많은 정보를 보려면 `rm --help' 하십시오.
centos2[root /dev]# rm -rf /home/*
centos2[root /dev]# umount /dev/sdb1
centos2[root /dev]# umount /dev/newhome
umount: /dev/newhome: not found
centos2[root /dev]# umount /newhome
centos2[root /dev]# mount /dev/test_vg/test_lg1 /home
centos2[root /dev]#
centos2[root /dev]#
centos2[root /dev]#
centos2[root /dev]# su -user1
su: 부적절한 옵션 -- u
더 많은 정보를 보려면 `su --help' 하십시오.
centos2[root /dev]# su -user
su: 부적절한 옵션 -- u
더 많은 정보를 보려면 `su --help' 하십시오.
centos2[root /dev]#
centos2[root /dev]#
centos2[root /dev]#
centos2[root /dev]# cd ~
centos2[root /root]# ls
Desktop anaconda-ks.cfg install.log install.log.syslog
centos2[root /root]# cd home
-bash: cd: home: 그런 파일이나 디렉토리가 없음
centos2[root /root]# ls
Desktop anaconda-ks.cfg install.log install.log.syslog
centos2[root /root]# cd /home
centos2[root /home]# ls
bigfile user1 user3 xuser2 xuser4 xuser6
lost+found user2 xuser1 xuser3 xuser5
centos2[root /home]#
centos2[root /home]#
centos2[root /home]#
centos2[root /home]# df -h | tail -2
/dev/mapper/test_vg-test_lg1
788M 476M 272M 64% /home
You have new mail in /var/spool/mail/root
centos2[root /home]# cd /dev/test_vg/
centos2[root /dev/test_vg]# ls
test_lg1 test_lg2
centos2[root /dev/test_vg]# ls -l test_lg1
lrwxrwxrwx 1 root root 28 6월 29 04:31 test_lg1 -> /dev/mapper/test_vg-test_lg1
centos2[root /dev/test_vg]# useradd kuser1
centos2[root /dev/test_vg]# ls /home
bigfile lost+found user2 xuser1 xuser3 xuser5
kuser1 user1 user3 xuser2 xuser4 xuser6
centos2[root /dev/test_vg]# df -h | tail -2
/dev/mapper/test_vg-test_lg1
788M 476M 272M 64% /home
centos2[root /dev/test_vg]# 용량 더 체우자
-bash: 용량: command not found
centos2[root /dev/test_vg]# dd if=/dev/zero of=/home/bigfile2 bs=1024k count=272
272+0 records in
272+0 records out
285212672 bytes (285 MB) copied, 20.6272 seconds, 13.8 MB/s
centos2[root /dev/test_vg]# df -h | tail -2
/dev/mapper/test_vg-test_lg1
788M 749M 0 100% /home
centos2[root /dev/test_vg]# 용량 다 찾다.ㅠ
centos2[root /dev/test_vg]# 데이터가 있는 상태에서 더 공간을 늘릴수 있다.
centos2[root /dev/test_vg]# 올~~
centos2[root /dev/test_vg]# cd /dev
centos2[root /dev]# ls sd*
sda sda1 sda2 sdb sdb1 sdc sdc1 sdd sdd1 sde sdf sdg
centos2[root /dev]# fdisk /dev/sde
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-512, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-512, default 512):
Using default value 512
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
centos2[root /dev]# pvcreate /dev/sde1
Writing physical volume data to disk "/dev/sde1"
Physical volume "/dev/sde1" successfully created
centos2[root /dev]# pvdisplay
--- Physical volume ---
PV Name /dev/sdc1
VG Name test_vg
PV Size 511.98 MB / not usable 3.98 MB
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 127
Free PE 0
Allocated PE 127
PV UUID upKip1-1HC4-unLS-nGwJ-0OEp-Mhzo-oI5uMK
--- Physical volume ---
PV Name /dev/sdd1
VG Name test_vg
PV Size 511.98 MB / not usable 3.98 MB
Allocatable yes (but full)
PE Size (KByte) 4096
Total PE 127
Free PE 0
Allocated PE 127
PV UUID YkyQ8Z-TJyN-EZ22-Uni8-yT8S-QOa9-XJKqNq
"/dev/sde1" is a new physical volume of "511.98 MB"
--- NEW Physical volume ---
PV Name /dev/sde1
VG Name
PV Size 511.98 MB
Allocatable NO
PE Size (KByte) 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID lYP53Y-oBsy-ucAu-r341-OPUT-rsE6-SQnkEM
centos2[root /dev]#
centos2[root /dev]#
centos2[root /dev]# vg
vgcfgbackup vgconvert vgextend vgmknodes vgs
vgcfgrestore vgcreate vgimport vgreduce vgscan
vgchange vgdisplay vgimportclone vgremove vgsplit
vgck vgexport vgmerge vgrename
centos2[root /dev]# vgextend test_vg /dev/sde1
Volume group "test_vg" successfully extended
centos2[root /dev]# vgdisplay
--- Volume group ---
VG Name test_vg
System ID
Format lvm2
Metadata Areas 3
Metadata Sequence No 4
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 1
Max PV 0
Cur PV 3
Act PV 3
VG Size 1.49 GB
PE Size 4.00 MB
Total PE 381
Alloc PE / Size 254 / 1016.00 MB
Free PE / Size 127 / 508.00 MB
VG UUID aoLldA-1I6c-1aGc-B5Hx-FcZm-G2V5-GossVy
centos2[root /dev]# 1.5기가로 늘어났다. 올~~
centos2[root /dev]# lvre
lvreduce lvremove lvrename lvresize
centos2[root /dev]# lvresize --size +508M /dev/test_vg/test_lg1
Extending logical volume test_lg1 to 1.28 GB
Logical volume test_lg1 successfully resized
centos2[root /dev]# 올~~800에서 500추가 해서 1.2기가 올~~
-bash: 올~~800에서: command not found
centos2[root /dev]# umount /newhome/
umount: /newhome/: not mounted
centos2[root /dev]# umount /home/
centos2[root /dev]# mount /dev//test_vg/test_lg1 /home/
centos2[root /dev]# df -h | tail -2
/dev/mapper/test_vg-test_lg1
788M 749M 0 100% /home
centos2[root /dev]# 잉? 800매가네 ㅡㅡ;
centos2[root /dev]# pvdisplay | grep -i gb
centos2[root /dev]# lvdisplay | grep -i gb
LV Size 1.28 GB
centos2[root /dev]# 여기는 1.2기가네 ㅡㅡ 뭘까?
centos2[root /dev]# lvdisplay
--- Logical volume ---
LV Name /dev/test_vg/test_lg1
VG Name test_vg
LV UUID hJFHkS-rYS7-zaDJ-8AU7-oEuM-Xw3g-Z1Dmpx
LV Write Access read/write
LV Status available
# open 1
LV Size 1.28 GB
Current LE 327
Segments 3
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Name /dev/test_vg/test_lg2
VG Name test_vg
LV UUID O39b3Y-LUr2-uL4q-7uyv-iHpo-tPev-N1VgJJ
LV Write Access read/write
LV Status available
# open 0
LV Size 216.00 MB
Current LE 54
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
centos2[root /dev]# 분명 1.2기데 이상하
centos2[root /dev]# dump2fs /dev/test_vg/test_lg1
-bash: dump2fs: command not found
centos2[root /dev]# dumpe2fs /dev/test_vg/test_lg1
dumpe2fs 1.39 (29-May-2006)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 02dda20f-72a3-4e08-bf93-1b3c2045fb0c
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal resize_inode dir_index filetype needs_recovery sparse_super large_file
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 102592
Block count: 204800
Reserved block count: 10240
Free blocks: 10081
Free inodes: 102457
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 49
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 14656
Inode blocks per group: 458
Filesystem created: Sun Jun 29 04:39:42 2014
Last mount time: Sun Jun 29 05:15:18 2014
Last write time: Sun Jun 29 05:15:18 2014
Mount count: 3
Maximum mount count: 32
Last checked: Sun Jun 29 04:39:42 2014
Check interval: 15552000 (6 months)
Next check after: Fri Dec 26 04:39:42 2014
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: tea
Directory Hash Seed: cf0afcd8-c99d-4a7b-bc04-ab3bb9961126
Journal backup: inode blocks
Journal size: 16M
Group 0: (Blocks 0-32767)
Primary superblock at 0, Group descriptors at 1-1
Reserved GDT blocks at 2-50
Block bitmap at 51 (+51), Inode bitmap at 52 (+52)
Inode table at 53-510 (+53)
10071 free blocks, 14626 free inodes, 8 directories
Free blocks: 6301-10239, 10252-16383
Free inodes: 31-14656
Group 1: (Blocks 32768-65535)
Backup superblock at 32768, Group descriptors at 32769-32769
Reserved GDT blocks at 32770-32818
Block bitmap at 32819 (+51), Inode bitmap at 32820 (+52)
Inode table at 32821-33278 (+53)
1 free blocks, 14644 free inodes, 2 directories
Free blocks: 33279
Free inodes: 14669-29312
Group 2: (Blocks 65536-98303)
Block bitmap at 65536 (+0), Inode bitmap at 65537 (+1)
Inode table at 65538-65995 (+2)
2 free blocks, 14644 free inodes, 2 directories
Free blocks: 65998-65999
Free inodes: 29325-43968
Group 3: (Blocks 98304-131071)
Backup superblock at 98304, Group descriptors at 98305-98305
Reserved GDT blocks at 98306-98354
Block bitmap at 98355 (+51), Inode bitmap at 98356 (+52)
Inode table at 98357-98814 (+53)
0 free blocks, 14654 free inodes, 2 directories
Free blocks:
Free inodes: 43971-58624
Group 4: (Blocks 131072-163839)
Block bitmap at 131072 (+0), Inode bitmap at 131073 (+1)
Inode table at 131074-131531 (+2)
0 free blocks, 14608 free inodes, 36 directories
Free blocks:
Free inodes: 58673-73280
Group 5: (Blocks 163840-196607)
Backup superblock at 163840, Group descriptors at 163841-163841
Reserved GDT blocks at 163842-163890
Block bitmap at 163891 (+51), Inode bitmap at 163892 (+52)
Inode table at 163893-164350 (+53)
3 free blocks, 14642 free inodes, 6 directories
Free blocks: 164351, 180238-180239
Free inodes: 73295-87936
Group 6: (Blocks 196608-204799)
Block bitmap at 196608 (+0), Inode bitmap at 196609 (+1)
Inode table at 196610-197067 (+2)
4 free blocks, 14639 free inodes, 6 directories
Free blocks: 197068-197071
Free inodes: 87954-102592
centos2[root /dev]# umount /home
centos2[root /dev]# fsck /dev/test_vg/test_lg1
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
/dev/test_vg/test_lg1: clean, 135/102592 files, 194719/204800 blocks
centos2[root /dev]# 만약을 위해서 에러 검
centos2[root /dev]# resize2fs /dev/test_vg/test_lg1
resize2fs 1.39 (29-May-2006)
Please run 'e2fsck -f /dev/test_vg/test_lg1' first.
centos2[root /dev]# 오류 검사하라고 메시지 뜬다..
centos2[root /dev]# -f 옵션을 널어서 에러 체크 해라 ..
centos2[root /dev]# fsck -f /dev/test_vg/test_lg1
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/test_vg/test_lg1: 135/102592 files (0.7% non-contiguous), 194719/204800 blocks
centos2[root /dev]# resize2fs /dev/test_vg/test_lg1
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/test_vg/test_lg1 to 334848 (4k) blocks.
The filesystem on /dev/test_vg/test_lg1 is now 334848 blocks long.
centos2[root /dev]# 남은 부분이 포멧 되었다.~
centos2[root /dev]# dumpe2fs /dev/test_vg/test_lg1
dumpe2fs 1.39 (29-May-2006)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 02dda20f-72a3-4e08-bf93-1b3c2045fb0c
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal resize_inode dir_index filetype sparse_super large_file
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 161216
Block count: 334848
Reserved block count: 16742
Free blocks: 138187
Free inodes: 161081
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 49
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 14656
Inode blocks per group: 458
Filesystem created: Sun Jun 29 04:39:42 2014
Last mount time: Sun Jun 29 05:15:18 2014
Last write time: Sun Jun 29 05:21:50 2014
Mount count: 0
Maximum mount count: 32
Last checked: Sun Jun 29 05:21:41 2014
Check interval: 15552000 (6 months)
Next check after: Fri Dec 26 05:21:41 2014
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: tea
Directory Hash Seed: cf0afcd8-c99d-4a7b-bc04-ab3bb9961126
Journal backup: inode blocks
Journal size: 16M
Group 0: (Blocks 0-32767)
Primary superblock at 0, Group descriptors at 1-1
Reserved GDT blocks at 2-50
Block bitmap at 51 (+51), Inode bitmap at 52 (+52)
Inode table at 53-510 (+53)
10071 free blocks, 14626 free inodes, 8 directories
Free blocks: 6301-10239, 10252-16383
Free inodes: 31-14656
Group 1: (Blocks 32768-65535)
Backup superblock at 32768, Group descriptors at 32769-32769
Reserved GDT blocks at 32770-32818
Block bitmap at 32819 (+51), Inode bitmap at 32820 (+52)
Inode table at 32821-33278 (+53)
1 free blocks, 14644 free inodes, 2 directories
Free blocks: 33279
Free inodes: 14669-29312
Group 2: (Blocks 65536-98303)
Block bitmap at 65536 (+0), Inode bitmap at 65537 (+1)
Inode table at 65538-65995 (+2)
2 free blocks, 14644 free inodes, 2 directories
Free blocks: 65998-65999
Free inodes: 29325-43968
Group 3: (Blocks 98304-131071)
Backup superblock at 98304, Group descriptors at 98305-98305
Reserved GDT blocks at 98306-98354
Block bitmap at 98355 (+51), Inode bitmap at 98356 (+52)
Inode table at 98357-98814 (+53)
0 free blocks, 14654 free inodes, 2 directories
Free blocks:
Free inodes: 43971-58624
Group 4: (Blocks 131072-163839)
Block bitmap at 131072 (+0), Inode bitmap at 131073 (+1)
Inode table at 131074-131531 (+2)
0 free blocks, 14608 free inodes, 36 directories
Free blocks:
Free inodes: 58673-73280
Group 5: (Blocks 163840-196607)
Backup superblock at 163840, Group descriptors at 163841-163841
Reserved GDT blocks at 163842-163890
Block bitmap at 163891 (+51), Inode bitmap at 163892 (+52)
Inode table at 163893-164350 (+53)
3 free blocks, 14642 free inodes, 6 directories
Free blocks: 164351, 180238-180239
Free inodes: 73295-87936
Group 6: (Blocks 196608-229375)
Block bitmap at 196608 (+0), Inode bitmap at 196609 (+1)
Inode table at 196610-197067 (+2)
24580 free blocks, 14639 free inodes, 6 directories
Free blocks: 197068-197071, 204800-229375
Free inodes: 87954-102592
Group 7: (Blocks 229376-262143)
Backup superblock at 229376, Group descriptors at 229377-229377
Reserved GDT blocks at 229378-229426
Block bitmap at 229427 (+51), Inode bitmap at 229428 (+52)
Inode table at 229429-229886 (+53)
32257 free blocks, 14656 free inodes, 0 directories
Free blocks: 229887-262143
Free inodes: 102593-117248
Group 8: (Blocks 262144-294911)
Block bitmap at 262144 (+0), Inode bitmap at 262145 (+1)
Inode table at 262146-262603 (+2)
32308 free blocks, 14656 free inodes, 0 directories
Free blocks: 262604-294911
Free inodes: 117249-131904
Group 9: (Blocks 294912-327679)
Backup superblock at 294912, Group descriptors at 294913-294913
Reserved GDT blocks at 294914-294962
Block bitmap at 294963 (+51), Inode bitmap at 294964 (+52)
Inode table at 294965-295422 (+53)
32257 free blocks, 14656 free inodes, 0 directories
Free blocks: 295423-327679
Free inodes: 131905-146560
Group 10: (Blocks 327680-334847)
Block bitmap at 327680 (+0), Inode bitmap at 327681 (+1)
Inode table at 327682-328139 (+2)
6708 free blocks, 14656 free inodes, 0 directories
Free blocks: 328140-334847
Free inodes: 146561-161216
centos2[root /dev]# mount /dev/test_vg/test_lg1 /home
centos2[root /dev]# df -h | tail -2
/dev/mapper/test_vg-test_lg1
1.3G 749M 475M 62% /home
centos2[root /dev]# 공간이 늘었다.
추가로 500매가 늘리기
centos2[root /dev]# mount /dev/test_vg/test_lg1 /home
centos2[root /dev]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 14G 4.3G 8.2G 35% /
tmpfs 394M 0 394M 0% /dev/shm
/dev/hdc 3.9G 3.9G 0 100% /media/CentOS_5.9_Final
/dev/mapper/test_vg-test_lg1
1.3G 749M 475M 62% /home
centos2[root /dev]# dd if=/dev/zero of=/home/bigfile3 bs=1024k count=475
475+0 records in
475+0 records out
498073600 bytes (498 MB) copied, 9.92264 seconds, 50.2 MB/s
centos2[root /dev]# fdisk
Usage: fdisk [-l] [-b SSZ] [-u] device
E.g.: fdisk /dev/hda (for the first IDE disk)
or: fdisk /dev/sdc (for the third SCSI disk)
or: fdisk /dev/eda (for the first PS/2 ESDI drive)
or: fdisk /dev/rd/c0d0 or: fdisk /dev/ida/c0d0 (for RAID devices)
...
centos2[root /dev]# fdisk /dev/sde
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
Partition 1 is already defined. Delete it before re-adding it.
Command (m for help):
centos2[root /dev]# fdisk /dev/sde
Command (m for help):
centos2[root /dev]# fdisk /dev/sdf
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-512, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-512, default 512):
Using default value 512
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 83
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): 8e
Changed system type of partition 1 to 8e (Linux LVM)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
centos2[root /dev]# pvcreate /dev/sdf1
Writing physical volume data to disk "/dev/sdf1"
Physical volume "/dev/sdf1" successfully created
centos2[root /dev]# vgextend test_vg /dev/sdf1
Volume group "test_vg" successfully extended
centos2[root /dev]# vgdisplay
--- Volume group ---
VG Name test_vg
System ID
Format lvm2
Metadata Areas 4
Metadata Sequence No 6
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 1
Max PV 0
Cur PV 4
Act PV 4
VG Size 1.98 GB
PE Size 4.00 MB
Total PE 508
Alloc PE / Size 381 / 1.49 GB
Free PE / Size 127 / 508.00 MB
VG UUID aoLldA-1I6c-1aGc-B5Hx-FcZm-G2V5-GossVy
centos2[root /dev]# lvresize --size +508M /dev/test_vg/test_lg1
Extending logical volume test_lg1 to 1.77 GB
Logical volume test_lg1 successfully resized
centos2[root /dev]# umount /home
centos2[root /dev]# fsck -f /dev/test_vg/test_lg1
fsck 1.39 (29-May-2006)
e2fsck 1.39 (29-May-2006)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/test_vg/test_lg1: 136/161216 files (0.7% non-contiguous), 318381/334848 blocks
centos2[root /dev]# resize2fs /dev/test_vg/test_lg1
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/test_vg/test_lg1 to 464896 (4k) blocks.
The filesystem on /dev/test_vg/test_lg1 is now 464896 blocks long.
centos2[root /dev]# mount /dev/test_vg/test_lg1 /home
centos2[root /dev]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 14G 4.3G 8.2G 35% /
tmpfs 394M 0 394M 0% /dev/shm
/dev/hdc 3.9G 3.9G 0 100% /media/CentOS_5.9_Final
/dev/mapper/test_vg-test_lg1
1.8G 1.2G 475M 73% /home
centos2[root /etc]# e2label /dev/sdb1 ''
centos2[root /etc]# e2label /dev/test_vg//test_lg1 /home
centos2[root /etc]# umount -a
umount: /var/lib/nfs/rpc_pipefs: device is busy
umount: /: device is busy
centos2[root /etc]# mount -a
mount: /dev/sdc1 already mounted or /mailhome busy
centos2[root /etc]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 14G 4.3G 8.2G 35% /
/dev/mapper/test_vg-test_lg1
1.8G 1.2G 475M 73% /home
tmpfs 394M 0 394M 0% /dev/shm
centos2[root /etc]#
centos2[root /etc]#
레이드 구성하기
centos2[root /root]# cd /dev
centos2[root /dev]# ls sdc sdd
sdc sdd
centos2[root /dev]# fdisk -l sdc sdd
Disk sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
Disk sdd: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
centos2[root /dev]# fdisk /dev/sdc
Command (m for help): n
Command action
e extended
p primary partition (1-4)
1
Invalid partition number for type `1'
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-512, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-512, default 512):
Using default value 512
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): l
0 Empty 1e Hidden W95 FAT1 80 Old Minix bf Solaris
1 FAT12 24 NEC DOS 81 Minix / old Lin c1 DRDOS/sec (FAT-
2 XENIX root 39 Plan 9 82 Linux swap / So c4 DRDOS/sec (FAT-
3 XENIX usr 3c PartitionMagic 83 Linux c6 DRDOS/sec (FAT-
4 FAT16 <32M 40 Venix 80286 84 OS/2 hidden C: c7 Syrinx
5 Extended 41 PPC PReP Boot 85 Linux extended da Non-FS data
6 FAT16 42 SFS 86 NTFS volume set db CP/M / CTOS / .
7 HPFS/NTFS 4d QNX4.x 87 NTFS volume set de Dell Utility
8 AIX 4e QNX4.x 2nd part 88 Linux plaintext df BootIt
9 AIX bootable 4f QNX4.x 3rd part 8e Linux LVM e1 DOS access
a OS/2 Boot Manag 50 OnTrack DM 93 Amoeba e3 DOS R/O
b W95 FAT32 51 OnTrack DM6 Aux 94 Amoeba BBT e4 SpeedStor
c W95 FAT32 (LBA) 52 CP/M 9f BSD/OS eb BeOS fs
e W95 FAT16 (LBA) 53 OnTrack DM6 Aux a0 IBM Thinkpad hi ee EFI GPT
f W95 Ext'd (LBA) 54 OnTrackDM6 a5 FreeBSD ef EFI (FAT-12/16/
10 OPUS 55 EZ-Drive a6 OpenBSD f0 Linux/PA-RISC b
11 Hidden FAT12 56 Golden Bow a7 NeXTSTEP f1 SpeedStor
12 Compaq diagnost 5c Priam Edisk a8 Darwin UFS f4 SpeedStor
14 Hidden FAT16 <3 61 SpeedStor a9 NetBSD f2 DOS secondary
16 Hidden FAT16 63 GNU HURD or Sys ab Darwin boot fb VMware VMFS
17 Hidden HPFS/NTF 64 Novell Netware b7 BSDI fs fc VMware VMKCORE
18 AST SmartSleep 65 Novell Netware b8 BSDI swap fd Linux raid auto
1b Hidden W95 FAT3 70 DiskSecure Mult bb Boot Wizard hid fe LANstep
1c Hidden W95 FAT3 75 PC/IX be Solaris boot ff BBT
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
centos2[root /dev]# fdisk /dev/sdd
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-512, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-512, default 512):
Using default value 512
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): fd
Changed system type of partition 1 to fd (Linux raid autodetect)
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
centos2[root /dev]# fdisk -l sdc sdd
Disk sdc: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
sdc1 1 512 524272 fd Linux raid autodetect
Disk sdd: 536 MB, 536870912 bytes
64 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Device Boot Start End Blocks Id System
sdd1 1 512 524272 fd Linux raid autodetect
centos2[root /dev]# ls md*
md0
centos2[root /dev]# meta
metacity metacity-theme-viewer metaflac
metacity-message metacity-window-demo
centos2[root /dev]# mdadm --create /dev/md0 --level=0 --raid-devices=2 /dev/sdc1 /dev/sdd1
mdadm: array /dev/md0 started.
centos2[root /dev]# cat /proc/mdstat
Personalities : [raid0]
md0 : active raid0 sdd1[1] sdc1[0]
1048320 blocks 64k chunks
unused devices: <none>
centos2[root /dev]# 레이드 만들어
centos2[root /dev]# 레이드 만들어짐.
centos2[root /dev]# 파티션 작업 없이 발로 포멧.
-bash: 파티션: command not found
centos2[root /dev]# mkfs -t ext3 /dev/dm0
mke2fs 1.39 (29-May-2006)
Could not stat /dev/dm0 --- 그런 파일이나 디렉토리가 없음
The device apparently does not exist; did you specify it correctly?
centos2[root /dev]# mkfs -t ext3 /dev/md0
mke2fs 1.39 (29-May-2006)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
131072 inodes, 262080 blocks
13104 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
16384 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
centos2[root /dev]# mkdir /raid0
centos2[root /dev]# mount /dev/md0 /raid0/
centos2[root /dev]# df -h | tail -i -2
tail: 부적절한 옵션 -- i
더 많은 정보를 보려면 `tail --help' 하십시오.
centos2[root /dev]# df -h | tail -i 2
tail: 부적절한 옵션 -- i
더 많은 정보를 보려면 `tail --help' 하십시오.
centos2[root /dev]# df -h | tail -i -1
tail: 부적절한 옵션 -- i
더 많은 정보를 보려면 `tail --help' 하십시오.
centos2[root /dev]# df -h | tail -1
/dev/md0 1008M 18M 940M 2% /raid0
centos2[root /dev]# cp /bin/ksh
cp: missing destination file operand after `/bin/ksh'
더 많은 정보를 보려면 `cp --help' 하십시오.
centos2[root /dev]#
'Linux' 카테고리의 다른 글
centos 9 error "signature not supported hash algorithm sha1 not available" (0) | 2022.08.04 |
---|---|
19일 레이드 1, 5 구성 Quota (0) | 2014.07.01 |
17일차 ext2 ext3 차이, 파일세스템 및 복구 (0) | 2014.06.27 |
15일 자동마운트 (0) | 2014.06.25 |
14일 마운트 공부 (0) | 2014.06.24 |