PDA

View Full Version : Using e2fsprogs-1.4.2-1 on EXT4


SlowJet
3rd October 2008, 06:33 AM
Resizing Logical Volumes EXT4 using e2fsprogs 1.41.2-1
Mission:
Phase I
reduce LogVol14var by 1GB (to get space for other lv's)
increase LogVol14root by 224MB (less then 1 extent remaining)
Phase II not shown
increase LogVol14usr by 400MB (85%+ used)
reduce LogVol14home by 4GB (to make snapshot space)

VG-LV must be active but not mounted (LiveCD, rescue or second system)

# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol10home VolGroup10 -wi-ao 7.81G
LogVol10slash VolGroup10 -wi-ao 3.12G
LogVol10swap VolGroup10 -wi-ao 2.00G
LogVol10tmp VolGroup10 -wi-ao 960.00M
LogVol10usr VolGroup10 -wi-ao 4.69G
LogVol10var VolGroup10 -wi-ao 2.34G
LogVol10x4 VolGroup10 -wi-a- 9.00G
LogVol14home VolGroup14 -wi-a- 97.88G
LogVol14root VolGroup14 -wi-a- 480.00M
LogVol14swap VolGroup14 -wi-ao 4.00G
LogVol14tmp VolGroup14 -wi-a- 2.00G
LogVol14usr VolGroup14 -wi-a- 4.09G
LogVol14var VolGroup14 -wi-a- 3.00G


# e2fsck -f /dev/VolGroup14/LogVol14var
e2fsck 1.41.2 (02-Oct-2008)
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/VolGroup14/LogVol14var: 809/196608 files (9.6% non-contiguous), 71592/786432 blocks
[root@Tasha-19 ~]# resize2fs -p /dev/VolGroup14/LogVol14var 2G
resize2fs 1.41.2 (02-Oct-2008)
Resizing the filesystem on /dev/VolGroup14/LogVol14var to 524288 (4k) blocks.
Begin pass 3 (max = 24)
Scanning inode table XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/VolGroup14/LogVol14var is now 524288 blocks long.

[root@Tasha-19 ~]# man lvresize
[root@Tasha-19 ~]# man lvreduce
Formatting page, please wait...
###test it
[root@Tasha-19 ~]# lvreduce --size 2G VolGroup14/LogVol14var --test
Test mode: Metadata will NOT be updated.
WARNING: Reducing active logical volume to 2.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce LogVol14var? [y/n]: y
Reducing logical volume LogVol14var to 2.00 GB
Logical volume LogVol14var successfully resized

### do it
[root@Tasha-19 ~]# lvreduce --size 2G VolGroup14/LogVol14var
WARNING: Reducing active logical volume to 2.00 GB
THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce LogVol14var? [y/n]: y
Reducing logical volume LogVol14var to 2.00 GB
Logical volume LogVol14var successfully resized
### results
LogVol14var VolGroup14 -wi-a- 2.00G

### increase lv root test it
# lvresize --size +200M VolGroup14/LogVol14root --test
Test mode: Metadata will NOT be updated.
Rounding up size to full physical extent 224.00 MB
Extending logical volume LogVol14root to 704.00 MB
Logical volume LogVol14root successfully resized
### size different test again
[root@Tasha-19 ~]# lvresize --size +224M VolGroup14/LogVol14root --test
Test mode: Metadata will NOT be updated.
Extending logical volume LogVol14root to 704.00 MB
Logical volume LogVol14root successfully resized
### do it
[root@Tasha-19 ~]# lvresize --size +224M VolGroup14/LogVol14root
Extending logical volume LogVol14root to 704.00 MB
Logical volume LogVol14root successfully resized

### resize fs to fill lv
[root@Tasha-19 ~]# resize2fs /dev/VolGroup14/LogVol14root
resize2fs 1.41.2 (02-Oct-2008)
Please run 'e2fsck -f /dev/VolGroup14/LogVol14root' first.

### run ck
[root@Tasha-19 ~]# e2fsck -f /dev/VolGroup14/LogVol14root
e2fsck 1.41.2 (02-Oct-2008)
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/VolGroup14/LogVol14root: 12711/122880 files (2.5% non-contiguous), 437964/491520 blocks
### do it
[root@Tasha-19 ~]# resize2fs /dev/VolGroup14/LogVol14root
resize2fs 1.41.2 (02-Oct-2008)
Resizing the filesystem on /dev/VolGroup14/LogVol14root to 720896 (1k) blocks.
The filesystem on /dev/VolGroup14/LogVol14root is now 720896 blocks long.
### results
LogVol14root VolGroup14 -wi-a- 704.00M


SJ:

SlowJet
4th October 2008, 06:12 PM
I thot the f/s would need to be formated to get the internal journal but I not so.
The journal is now in the middle of the f/s and is checksumed.
This means I do not need to reinstall.

$ dmesg | grep EXT4
EXT4-fs: mounted filesystem with ordered data mode.
EXT4-fs: delayed allocation enabled
EXT4-fs: file extents enabled
EXT4-fs: mballoc enabled
EXT4 FS on dm-0, internal journal
EXT4 FS on dm-4, internal journal
EXT4-fs: mounted filesystem with ordered data mode.
EXT4-fs: delayed allocation enabled
EXT4-fs: file extents enabled
EXT4-fs: mballoc enabled
EXT4 FS on dm-1, internal journal
EXT4-fs: mounted filesystem with ordered data mode.
EXT4-fs: delayed allocation enabled
EXT4-fs: file extents enabled
EXT4-fs: mballoc enabled
EXT4 FS on dm-2, internal journal
EXT4-fs: mounted filesystem with ordered data mode.
EXT4-fs: delayed allocation enabled
EXT4-fs: file extents enabled
EXT4-fs: mballoc enabled
EXT4 FS on dm-3, internal journal
EXT4-fs: mounted filesystem with ordered data mode.
EXT4-fs: delayed allocation enabled