Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] extending /usr partition...
Date: Sun, 22 Mar 2009 11:47:28
Message-Id: 200903221345.56656.alan.mckinnon@gmail.com
In Reply to: Re: [gentoo-user] extending /usr partition... by Jarry
1 On Sunday 22 March 2009 12:59:15 Jarry wrote:
2 > Are you sure? man resize2fs says:
3 >
4 > "...The resize2fs program will resize ext2 or ext3 file systems.
5 > It can be used to enlarge or shrink an unmounted file system
6 > located on device. If the filesystem is mounted, it can be used
7 > to expand the size of the mounted filesystem, assuming the kernel
8 > supports on-line resizing..."
9 >
10 > If I understand correctly, you can only extend ext3-partition
11 > with it. But shrinking must be done off-line, on unmounted fs...
12
13 Yes, and this is true for *any* filesystem. Some mature filesystems out there
14 don't support resizing at all in any form.
15
16 Enlarging a filesystems on line is easy. Make the device holding it bigger,
17 add new inodes, add inodes to the inode tree and Hey Presto! filesystem is
18 bigger. It's quick as you are *guaranteed* that the new inodes are not in use
19 until the resize ends.
20
21 Reducing is entirely different. You have to take inodes in use at the end of
22 the filesystem, move them to somewhere else, fix the pointers in other inodes
23 that point to them, repeat for all other inodes that will have to go away
24 after the resize. Yuck. Tricky code :-)
25
26 You are going to have this problem with any inode-based filesystem, not just
27 ext3.
28
29
30 --
31 alan dot mckinnon at gmail dot com