[plug] tip: cool mount + kernel2.4 trick

Craig Ringer craig at postnewspapers.com.au
Wed Jun 5 02:46:48 WST 2002


Hi all
For those not in the know (me 'till 5 mins ago) thought I'd mention a 
cool trick I just ran into.

I've just installed an 80 gig disk into the server here for a monster 
scratch disk, storage for stuff backed up on tape/CD but wanted online 
too, etc. The typical dilemma: how to partition given that I wanted 
/home on it too, and to limit space wastage.

I cheated.

Created one swap partiton (swap on a separate spindle to /, /usr, etc is 
always nice - I got about a 15-25% performance boost under artificial 
load from it) and the rest as a monster reiserfs partition. Created 
"home" and "netstore" on it, then created an fstab entry to mount it on 
/mnt/80g (w perms root.root 700).

not so useful, yes?

mount --bind /mnt/80g/home /home
mount --bind /mnt/80g/netstore /var/netstore

makes it a lot more fun. many people will know linux can do this (man 
mount - duh!) but I couldn't find any info quickly on how to automate it.

The fstab format you want is

srcdir 
dstdir 
none bind 0 0
(example)
/mnt/80g/home 
/home 
none 
bind 
0 0

(however I dont know if "bind" is needed in options, seems to work)

Sorry if this is obvious to everybody else from newbie to expert, but I 
thought it was very cool and somewhat obscure so I'd tell the list in 
case someone cared.

Oh - this is probably also good for machines with two or more _small_ 
disks that want to run something vaguely modern. Partitoning something like:

/dev/hda
	hda1	swap
	hda2	/boot (ext2)
	hda3	the rest (ext2)
/dev/hdb
	hdb1	entire disk (ext2)

then you can mount hdb on /mnt/disc2 and bind bits of it to /var etc as 
appropriate. Minimises space wastage on disk 2 that is common otherwise 
in having to have multiple partitons. I'll be setting this up on my 
housemate's "training" Debian box come the woody release, its got 2 2gig 
SCSI drives making it a bit cramped for a _full_ install + some storage.

fun fun fun (yes I am a sick, sick man, and yes I am at work at 3am - 
server upgrade, see prev post on kvm too, there is a sysadmin's sanity 
in the balance....*grin* )

-- 
Craig Ringer
GPG Key Fingerprint: AF1C ABFE 7E64 E9C8 FC27  C16E D3CE CDC0 0E93 380D
	-- if it ain't broke, add features 'till it is.




More information about the plug mailing list