LVM上のファイルシステム(ext3)の拡張する手順例を示す。
確認環境
- RHEL 5.4 on VMware Server 2
例
- ファイルシステム(ext3)をアンマウントする
[root@localhost ~]# df
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/sda2 10154020 3557116 6072784 37% /
/dev/sda1 256666 37292 206122 16% /boot
tmpfs 62192 0 62192 0% /dev/shm
/dev/mapper/VG0001-LV0001
51559 4956 43941 11% /mnt
[root@localhost ~]# umount /mnt
- LV(論理ボリューム)を拡張する
[root@localhost ~]# lvextend -L+12M /dev/VG0001/LV0001
Extending logical volume LV0001 to 64.00 MB
Logical volume LV0001 successfully resized
[root@localhost ~]# vgdisplay -v VG0001
Using volume group(s) on command line
Finding volume group "VG0001"
--- Volume group ---
VG Name VG0001
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 5
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 1
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 7.80 GB
PE Size 4.00 MB
Total PE 1998
Alloc PE / Size 16 / 64.00 MB
Free PE / Size 1982 / 7.74 GB
VG UUID Fusrtt-uqYJ-uNdZ-fepf-5hpt-554b-zKQuIj
--- Logical volume ---
LV Name /dev/VG0001/LV0001
VG Name VG0001
LV UUID V6JgvS-CD33-WvBo-TfE2-qRu2-765V-0YAhyR
LV Write Access read/write
LV Status available
# open 0
LV Size 64.00 MB
Current LE 16
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Physical volumes ---
PV Name /dev/sdb1
PV UUID EhMTvI-k3fq-eoRV-Hwkd-iA7G-p3Lk-QjSOsC
PV Status allocatable
Total PE / Free PE 999 / 983
PV Name /dev/sdb2
PV UUID zbmif7-hWP2-2VA2-sFNp-vbSw-O7Ce-rMErmL
PV Status allocatable
Total PE / Free PE 999 / 999
[root@localhost ~]#
- ファイルシステム(ext3)を拡張する
[root@localhost ~]# e2fsck -nfv /dev/VG0001/LV0001
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
11 inodes used (0.08%)
1 non-contiguous inode (9.1%)
# of inodes with ind/dind/tind blocks: 0/0/0
6645 blocks used (12.48%)
0 bad blocks
0 large files
0 regular files
2 directories
0 character device files
0 block device files
0 fifos
0 links
0 symbolic links (0 fast symbolic links)
0 sockets
--------
2 files
[root@localhost ~]# e2fsck -f /dev/VG0001/LV0001
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/VG0001/LV0001: 11/13328 files (9.1% non-contiguous), 6645/53248 blocks
[root@localhost ~]# resize2fs /dev/VG0001/LV0001
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/VG0001/LV0001 to 65536 (1k) blocks.
The filesystem on /dev/VG0001/LV0001 is now 65536 blocks long.
[root@localhost ~]#
- 再度マウントする
[root@localhost ~]# mount /dev/VG0001/LV0001 /mnt
[root@localhost ~]# df
Filesystem 1K-ブロック 使用 使用可 使用% マウント位置
/dev/sda2 10154020 3557124 6072776 37% /
/dev/sda1 256666 37292 206122 16% /boot
tmpfs 62192 0 62192 0% /dev/shm
/dev/mapper/VG0001-LV0001
63605 5163 55821 9% /mnt
[root@localhost ~]#
0 件のコメント:
コメントを投稿