Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm having a weird issue with resize2fs. I've performed all the commands and they all have been successful, however, my filesystem is the same size as it was before:

[oracle@server~]$ df -h /backup
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg2-lv_backup
                      985G  973G  2.4G 100% /backup

[root@server~]# pvcreate /dev/cciss/c0d4p1 
  Physical volume "/dev/cciss/c0d4p1" successfully created

[root@server~]# lvdisplay /dev/mapper/vg2-lv_backup | awk '/VG Name/{print $3}'
vg2

[root@server~]# vgextend vg2 /dev/cciss/c0d4p1 
  Volume group "vg2" successfully extended

[root@server~]# vgdisplay vg2 | awk '/Free *PE /{print $5}'
200

[root@server~]# lvextend -l +200 /dev/vg2/lv_backup 
  Extending logical volume lv_backup to 1000.78 GB
  Logical volume lv_backup successfully resized

[root@server~]# e2fsck -Cfp /dev/vg2/lv_backup 
e2fsck 1.39 (29-May-2006)
backups: clean, 1488/131072000 files, 258919596/262144000 blocks

[root@server~]# e2fsck -f /dev/mapper/vg2-lv_backup
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
backups: 1488/131072000 files (20.1% non-contiguous), 258919596/262144000 blocks

[root@server~]# resize2fs /dev/mapper/vg2-lv_backup
resize2fs 1.39 (29-May-2006)
Resizing the filesystem on /dev/mapper/vg2-lv_backup to 262348800 (4k) blocks.
The filesystem on /dev/mapper/vg2-lv_backup is now 262348800 blocks long.

The problem is that the initial filesystem was 1TB (almost) and the new one is 800GB, so the new logical volume should now be around 1.8TB. From here, you can see that both the drives are part of the same volume groups:

[root@server~]# pvs -v | grep vg2
    Scanning for physical volume names
  /dev/cciss/c0d0p1 vg2  lvm2 a-   1000.00G     0  1000.00G 4cjtXN-uQ60-5ZvU-dih7-m0Lw-5IQy-RYxmOb
  /dev/cciss/c0d4p1 vg2  lvm2 a-    800.00M     0   800.84M X2f4CR-QI7M-XO5g-TQVh-e3sa-ebu8-MxaqXY

However, it is not reflected:

[root@server~]# lvs -v | grep vg2
    Finding all logical volumes
  lv_backup             vg2     2 -wi-a- 1000.78G  -1  -1 253  73                                         IDEeg7-USRJ-OZLd-fC5t-kCxi-leHq-zfwoNF

Any suggestions?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

The lvextend command you executed would only extend the filesystem by 800MB (assuming default extent size), a rounding error when you're looking at TB filesystems. The -l flag means "extents" which, by default, are 4MB in size. If you wish to grow the filesystem by, say, 200GB, the command would be: lvextend -L +200G vg2/lv_backup. (Note the difference between -l and -L.)

The problem is that the initial filesystem was 1TB (almost) and the new one is 800GB, so the new logical volume should now be around 1.8TB. From here, you can see that both the drives are part of the same volume groups:

The initial filesystem was 1TB. The new disk is 800GB. You added that disk to the VG, then used 800MB of that disk to extend the LV, then grow the filesystem on the LV, leaving you with 1.0008TB in the LV. Then you grew the filesystem to fill the LV.

If you want to end up with a 1.8TB filesystem, do this:

lvextend -L +800G vg2/lv_backup

or:

lvextend -l 100%FREE vg2/lv_backup

Followed by the resize2fs command.

share|improve this answer
    
I was correct in all the commands I ran. Dumbass here, though, presented 800MB to the filesystem instead of 800GB. The MSA defaulted to MB, which I wasn't aware of until after the fact. I had to extend the logical drive on the MSA, delete the partition on the system and recreate it, after that I had to redo most of the resize/extend steps and finally got it to where it was suppose to be. Thanks for the insight :) –  drewrockshard Mar 5 '11 at 10:28

lvextend -l +200 /dev/vg2/lv_backup

+200 what?

share|improve this answer
    
The -l flag is extents. –  Insyte Mar 5 '11 at 9:34
    
@Insyte, 10x, cap. –  poige Mar 5 '11 at 17:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.