[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Grow an ext4 filesystem



Hello,

I have a storage server running Debian 7.6 x64.  It's an HP server with 24 HDDs and a hardware RAID controller.  It has a 2.9 TB ext4 filesystem which resides on a RAID 5 volume, and I recently needed to grow this filesystem so I added more disks to the volume and then used parted to grow the partition to the new size of 5 TB, so the space is now available in that partition:

# parted print /dev/sdb
Model: HP LOGICAL VOLUME (scsi)
Disk /dev/sdb: 5001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  5001GB  5001GB  ext4         primary

However, the filesystem is still stuck at the old size:

# df -h /dev/sdb1
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb1       2.7T  2.5T  104G  97% /export

I cannot figure out how to resize the actual ext4 filesystem to use the added space.  I have tried both resize2fs without any luck.  When I try resize2fs, I get this error:

# resize2fs /dev/sdb1
resize2fs 1.42.5 (29-Jul-2012)
resize2fs: /dev/sdb1: The combination of flex_bg and
    !resize_inode features is not supported by resize2fs.

In a potentially stupid move, I did indeed remove the resize_inode feature from this filesystem in order to get parted to work with it, which ultimately proved unnecessary, but now I cannot add it back:

# tune2fs -O resize_inode /dev/sdb1
tune2fs 1.42.5 (29-Jul-2012)
Setting filesystem feature 'resize_inode' not supported.

Is there a way I can resize this filesystem to use the additional 2 TB available to it?  The output of dumpe2fs is below (not including the data about the 22,355 groups in the filesystem):

dumpe2fs 1.42.5 (29-Jul-2012)
Filesystem volume name:   <none>
Last mounted on:          /export
Filesystem UUID:          0306070a-6d39-48da-8235-aa99c9e48141
Filesystem magic number:  0xEF53
Filesystem revision #:    1 (dynamic)
Filesystem features:      has_journal ext_attr dir_index filetype needs_recovery extent flex_bg sparse_super large_file
Filesystem flags:         signed_directory_hash
Default mount options:    user_xattr acl
Filesystem state:         clean
Errors behavior:          Continue
Filesystem OS type:       Linux
Inode count:              183140352
Block count:              732530432
Reserved block count:     36626521
Free blocks:              63964655
Free inodes:              183094383
First block:              0
Block size:               4096
Fragment size:            4096
Blocks per group:         32768
Fragments per group:      32768
Inodes per group:         8192
Inode blocks per group:   512
Flex block group size:    16
Filesystem created:       Thu Sep 18 14:40:07 2014
Last mount time:          Fri Jun  9 09:46:28 2017
Last write time:          Fri Jun  9 09:46:28 2017
Mount count:              5
Maximum mount count:      -1
Last checked:             Thu Jun  8 11:51:32 2017
Check interval:           0 (<none>)
Lifetime writes:          17 TB
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               256
Required extra isize:     28
Desired extra isize:      28
Journal inode:            8
Default directory hash:   half_md4
Directory Hash Seed:      81bb6e96-1eea-44c2-8dbd-f3b046f9b2a9
Journal backup:           inode blocks
Journal features:         journal_incompat_revoke
Journal size:             128M
Journal length:           32768
Journal sequence:         0x020ee1a8
Journal start:            1

Any help is greatly appreciated.  Thanks!

--
Dave Parker
Database & Systems Administrator
Utica College
Integrated Information Technology Services
(315) 792-3229
Registered Linux User #408177

Reply to: