Painted into a corner with i386 system and big FS ...

Jeremy Chadwick freebsd at jdc.parodius.com
Thu Dec 29 21:41:02 UTC 2011


On Thu, Dec 29, 2011 at 12:30:59PM -0800, UFS User wrote:
> I have an older i386 system with an 8TB filesystem on it, roughly 40 million inodes.

I'm sorry to hear that.  Your Subject line is more or less correct here;
you did this to yourself.  Don't do that!

> It appears that this is impossible to fsck - I have nudged up maxdsiz all the way to:
> kern.maxdsiz="3072000000"
> 
> and it's not enough. ?Any larger values cause the system to become unbootable.
> So, my plan is to boot 8.x amd64 FIXIT, and run fsck from the fixit environment.
> The issues I foresee are:
> 
> 1. Do I need to specify a maxdsiz in the 8.x fixit environment, or does this all just autoscale
> these days ?

It does not autoscale.  You will need to set it manually at the loader
prompt by entering 'set kern.maxdsiz="3072000000"' then 'boot'.

> I'm hoping my process doesn't grow past 3.5 GB, but do I need to burn a
> custom fixit to do that ? ?Or can I drop into the boot loader of FIXIT and set a custom load
> value ?

See above.

> Or perhaps I don't care at all and maxdsiz will just auto-scale to however large the fsck gets ?

Unknown; you will need to try, or someone else here can chime in with a
more accurate answer.

> 2. There is only 4 GB of physical in the system ... if I could grow to 3.072 GB process size in
> i386, then all else being equal, I should be able to grow to 3.5 in 8.x FIXIT, right ?

The 3.072GB value you came up with is related to i386; I can point you
to documentation that explains where the remaining 1GB goes (you can
thank x86 architecture for that).  On some systems it's as low as 2.8GB,
as it depends greatly on northbridge/MCH and devices on the system.

The 3.5GB value you came up with is equally as amusing.  How much you
actually get greatly varies on hardware details and so on.  Your
motherboard manufacturer should be able to tell you how much you'll get,
as long as you provide them a full list of any PCI/PCI-X/PCIe devices
you have installed in slots, and any system features you have enabled
(AHCI, on-board SCSI, etc.).

> 3. If I get larger than 4 GB in amd64, with a 4GB physical memory, I can always swap, right ?

Yes.  Prepare for the system to be extremely slow given massive I/O,
however.

You should be able to add swap to the system in real-time by executing
"swapon /dev/something" (e.g. swapon /dev/ada0s1b).

> But where would I swap to ?

Your swap partition, assuming you have one.  If not, you will need to
create one, or use a physically separate disk to act as swap.  Please do
not do something like "use a USB memory stick" (the I/O speed will be
pathetically slow), or "use mdconfig" (you will shoot yourself in the
foot doing this).

> Maybe I could mount my /var (which is clean, and is 4 GB in size)
> and swap to there ?

How would you do that?  /var is a UFS/UFS2 filesystem; swap is a
dedicated slice or partition.

> Can I specify a file-backed swapfile in FIXIT ?

man swapon(8).  The answer is no, AFAIK, and "fixit" has nothing to do
with it.  There is nothing different about "fixit" compared to a
standard FreeBSD system/installation.

My recommendation: get yourself access to an amd64 system that has a
large amount of memory on it (16-32GB if possible) and can be used for
this task, physically attach the disk to that system, and fsck it.

Once you're done, do something about the mess on your filesystem.
Upgrading to amd64 won't solve the problem either -- you've simply
abused the filesystem to the point where you're hurting from the abuse.
ZFS would handle this situation better, but I am in no way shape or form
going to tell you "go with ZFS going forward" because there are many
other nuances involved with that.  So let's not discuss that here.

-- 
| Jeremy Chadwick                                jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                   Mountain View, CA, US |
| Making life hard for others since 1977.               PGP 4BD6C0CB |



More information about the freebsd-fs mailing list