Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Jul 09, 2004 8:56 am 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
Continuing the discussion about the Gentoo distro filesystem in a more appropriate forum:

caker [originally in Sales Questions and Answers::Sounds cool, have questions] wrote:
pclissold wrote:
I think the extra size is due to the number of files needed during the build and the current 4k block size on the filesystem.

With the last Gentoo template update, I switch to 1k block size:
Code:
[root@host4 root]# tune2fs -l /vbin/fs/gentoo-1.4-small-1.2 | grep "Block size"
Block size:               1024


But even still, the "max number of files" limit was hit. Perhaps I missed something...

-Chris


I just installed the Gentoo distro on the minimum size partition and while there is >500MB of free space, there are only 189 inodes free.

Code:
fremont gentoo-test # tune2fs -l /dev/ubd/3 | grep "[Bb]lock\|[Ii]node"
Inode count:              135168
Block count:              1076224
Reserved block count:     0
Free blocks:              575531
Free inodes:              189
First block:              1
Block size:               1024
Blocks per group:         8192
Inodes per group:         1024
Inode blocks per group:   128
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               128
Journal inode:            8
fremont gentoo-test # 

The filesystem seems to have been created with a bytes-per-inode ratio of 8k but the system contains ~135 000 files with an average size of around 3k.

Could this be the reason for running out of files when creating the distro and having to make the partition larger than necessary? It also need looking at because installing the distro on the minimum size partition gives you a system that is all but unusable. Since you can't increase the number of inodes on an existing filesystem, the only options at the moment are to expand the partition (but you'll still likely end up short of inodes) or move the whole thing onto a new partition with a smaller bytes-per-inode ratio.

_________________
/ Peter


Top
   
 Post subject:
PostPosted: Fri Jul 16, 2004 7:42 pm 
Offline
Senior Newbie

Joined: Fri Jul 16, 2004 5:56 pm
Posts: 6
ICQ: 11149168
How to put your gentoo install on a saner FS in 10 easy steps:
  1. Use the distribution wizard to create a new gentoo distribution with a minimum size (1050MB) filesystem.
  2. Use the distribution wizard to create a new debian distribution with a minimum size (80MB) filesystem. This will be used to work on the gentoo images. No swap will be required.
  3. Under Disk Images, create a new disk image the desired size of your gentoo installation. Choose unformatted/raw as the filesystem type.
  4. Under configurations, set the debian profile to have the gentoo image as /dev/ubdb, and the blank image as /dev/ubdc
  5. Boot the debian image and log in
  6. Create your new gentoo fs with the following command:
    Code:
    mke2fs -j -i 4096 -b 1024 /dev/ubdc

    For even more inodes, you can change 4096 to 2048, but this comes at the cost of some space. You may also want to consider upping the block size to 2048.
  7. Create mount points and mount your FSes as follows:
    Code:
    mkdir /mnt/oldgentoo
    mount /dev/ubdb /mnt/oldgentoo
    mkdir /mnt/newgentoo
    mount /dev/ubdc /mnt/newgentoo
  8. Copy the contents of the old filesystem to the new one:
    Code:
    cp -axv /mnt/oldgentoo/* /mnt/newgentoo/
    (Drop the v from the copy command to make it faster but a whole lot less interesting to watch)
  9. Under configuration profiles, select the gentoo profile, and change the device on /dev/ubda to the new image
  10. Reboot into the gentoo profile, and enjoy your fixed FS!
And the result:
Code:
tune2fs -l /dev/ubdc | grep "[Bb]lock\|[Ii]node" 
Inode count:              526336
Block count:              2098176
Reserved block count:     104908
Free blocks:              1548283
Free inodes:              391357
First block:              1
Block size:               1024
Blocks per group:         8192
Inodes per group:         2048
Inode blocks per group:   256
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)
First inode:              11
Inode size:               128
Journal inode:            8

Plenty of free inodes!


Top
   
 Post subject:
PostPosted: Tue Jul 20, 2004 12:03 am 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
Thanks for that. I'll get this fixed and push it out tomorrow.

-Chris


Top
   
 Post subject:
PostPosted: Tue Jul 20, 2004 8:07 am 
Offline
Senior Member
User avatar

Joined: Fri Oct 24, 2003 3:51 pm
Posts: 965
Location: Netherlands
Arachnid wrote:
For even more inodes, you can change 4096 to 2048, but this comes at the cost of some space. You may also want to consider upping the block size to 2048.


The extra space consumed by changing from 4096 to 2048 bytes per inode is only 32MiB per GiB of partition for 128 byte inodes.

The values in your example look about right though - free space per available inode is ~ 4kB - fine unless you're planning something with a huge number of very small files, in which case you had best go with reisierfs anyway.

_________________
/ Peter


Top
   
 Post subject:
PostPosted: Tue Jul 20, 2004 5:27 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
Ok, it's out on the hosts. The new minimum size for Gentoo is 550M :)

Thanks again,
-Chris


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group