0

I read that ext3 filesystem can be extended "online". Does ext3 allow to extend a mounted partition?

I found this strange question on a test.

2
  • If they mean "when mounted" where they write "during work", then the answer is no.
    – NZD
    Commented Jun 13, 2016 at 6:56
  • yes, I mean "when mounted", thank you
    – Derek K
    Commented Jun 13, 2016 at 8:29

1 Answer 1

1

Reasonably recent Linux kernels (added sometime in the 2.6 series) can extend ext3/4 filesystems online (ie. while mounted):

localhost root # lvcreate -L100M -n test vg0
  Logical volume "test" created.
localhost root # mkfs.ext4 /dev/vg0/test
mke2fs 1.42.13 (17-May-2015)
Creating filesystem with 102400 1k blocks and 25688 inodes
Filesystem UUID: 1d97763f-7a37-41cc-b2a6-c5b2f93a616a
Superblock backups stored on blocks:
        8193, 24577, 40961, 57345, 73729

Allocating group tables: done
Writing inode tables: done
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

localhost root # mount /dev/vg0/test /mnt/test
localhost root # lvextend -L200M vg0/test
  Size of logical volume vg0/test changed from 100.00 MiB (25 extents) to 200.00 MiB (50 extents).
  Logical volume test successfully resized
localhost root # resize2fs /dev/vg0/test
resize2fs 1.42.13 (17-May-2015)
Filesystem at /dev/vg0/test is mounted on /mnt/test; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 1
The filesystem on /dev/vg0/test is now 204800 (1k) blocks long.
2
  • But if we don't use LVM and have no free space on partition, can we extend it (while ext3 is mounted)?
    – Derek K
    Commented Jun 13, 2016 at 8:50
  • No, of course not. The device (partition, LV, whatever) containing the filesystem has to be extended first.
    – Daniel B
    Commented Jun 13, 2016 at 9:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .