1 |
Andrea Conti writes: |
2 |
|
3 |
> > AFAIK you will gain more inodes when you increase the size. |
4 |
> |
5 |
> Only because by unless you specify a value mke2fs allocates a number of |
6 |
> inodes proportional to the size of the filesystem, with the default |
7 |
> being 1 inode every 16kB (see /etc/mke2fs.conf). |
8 |
> |
9 |
> But for ext[234] the number of inodes is fixed at filesystem creation, |
10 |
> so even if you use LVM you can't increase it by -- say -- growing the |
11 |
> underlying LV and then using resize2fs. |
12 |
|
13 |
So I just tried that, create a small fs, filled it until no inodes were |
14 |
left. Resized, and gained more inodes: |
15 |
|
16 |
weird ~ # lvcreate -L 4M -n inodetest weird |
17 |
Logical volume "inodetest" created |
18 |
|
19 |
weird ~ # mke2fs -j /dev/weird/inodetest |
20 |
mke2fs 1.41.14 (22-Dec-2010) |
21 |
Filesystem label= |
22 |
OS type: Linux |
23 |
Block size=1024 (log=0) |
24 |
Fragment size=1024 (log=0) |
25 |
Stride=0 blocks, Stripe width=0 blocks |
26 |
1024 inodes, 4096 blocks |
27 |
[...] |
28 |
|
29 |
weird ~ # mount /dev/weird/inodetest /mnt/ |
30 |
|
31 |
weird ~ # for (( i=1; ; i++ )) |
32 |
> do |
33 |
> touch "/mnt/$( printf "file %06d" $i )" || break |
34 |
> done |
35 |
touch: cannot touch `/mnt/file 001014': No space left on device |
36 |
|
37 |
weird ~ # df -i /mnt/ |
38 |
Filesystem Inodes IUsed IFree IUse% Mounted on |
39 |
/dev/mapper/weird-inodetest 1024 1024 0 100% /mnt |
40 |
|
41 |
weird ~ # lvresize -L 16M /dev/weird/inodetest |
42 |
Extending logical volume inodetest to 16,00 MiB |
43 |
Logical volume inodetest successfully resized |
44 |
|
45 |
weird ~ # resize2fs /dev/weird/inodetest |
46 |
resize2fs 1.41.14 (22-Dec-2010) |
47 |
Filesystem at /dev/weird/inodetest is mounted on /mnt; on-line resizing |
48 |
required |
49 |
old desc_blocks = 1, new_desc_blocks = 1 |
50 |
Performing an on-line resize of /dev/weird/inodetest to 16384 (1k) blocks. |
51 |
The filesystem on /dev/weird/inodetest is now 16384 blocks long. |
52 |
|
53 |
weird ~ # df -i /mnt/ |
54 |
Filesystem Inodes IUsed IFree IUse% Mounted on |
55 |
/dev/mapper/weird-inodetest 2048 1024 1024 50% /mnt |
56 |
|
57 |
Wonko |