[comp.os.minix] Changing the RAM disk size

evans@syd.dit.CSIRO.AU (Bruce.Evans) (05/29/91)

In article <12852@mentor.cc.purdue.edu> asg@sage.cc.purdue.edu (The Grand Master) writes:
>Problem is - I cannot figure out how to increase the size of my RAM
>disk. Specifying it at the (=, r, s, etc) prompt does no good, since it
>re-assigns it the size of the root FS disk (130). So how do I increase
>the size of the RamDisk? I tried making a copy of the root fs onto a disk
>that I had given a 400 block filesystem to. It boots most of the way, but
>then never gives me a login prompt. And if I try something like

Either you don't have enough (400K extended) memory or the copy was not
exact enough. 'cpdir -ms' is the best thing for making copies like this.
In 1.5 it does not preserve the sizes of special files, but this should
not affect bootability in this application, and you can rebuild the /dev
directory when convenient.

>cp /dev/ram /dev/PS0, it reassigns the filesystem in PS0 to only 130 blocks!

The size of an existing file system is fairly easy to change using de and
fsck. Practice with the following.

	cd /usr/tmp
	mkfs foo 1200	# use real filesystem in-place later
	fsck -a foobar	# tells me it has 1182 free zones
	de -w foo	# or your favourite binary editor
	<edit word at offset 0x402 from 1200 to 2400>	# works up to 8191
	q
	fsck -a foobar	# fixes the bitmaps and tells me it has 2382 free zones
	# Consider zeroing the extra zones. Usually unnecessary except for
	# security.

It's not so easy to increase the number of inodes (it's easy to reduce the
number :-). The number is in the word at offset 0x400 and is severely limited
by the number of blocks assigned for inodes. The limit of 8191 is from the
number of bits in a bitmap block and there are usually a lot to spare.
-- 
Bruce Evans		evans@syd.dit.csiro.au