Re: Ramdisks and tmpfs problems

Denis Vlasenko (vda@port.imtp.ilyichevsk.odessa.ua)
Wed, 10 Apr 2002 13:31:14 -0200


On 10 April 2002 05:45, Sean Hunter wrote:
> On Tue, Apr 09, 2002 at 02:46:39PM -0400, Geoffrey Gallaway wrote:
> > So no go with ram disks (this is kernel 2.4.18 on a 3 gig RAM dual PIII
> > 1gig, BTW). So now to try tmpfs. Since I need to copy the existing files
> > in /etc off to tmpfs I have to create a "temporary" tmpfs, copy /etc off
> > to it then create another tmpfs on top of the existing /etc and copy from
> > the "temporary" tempfs back to the new /etc. I came up with the following
> > commands:
> > mount -w -n -t tmpfs -o defaults tmpfs /mnt
> > cp -axf /etc /mnt
> > mount -w -t tmpfs -o defaults tmpfs /etc
> > cp -axf /mnt/etc/* /etc/
> > umount /mnt
> > # -- Reapeat for /var and /tmp --
>
> Wouldn't this be easier?
>
> mount -t tmpfs none /dev/shm
> cp -axf /etc/* !$
> mount --bind /dev/shm /etc

/dev is for devices, why do you use it for mounting filesystems?
I use /mnt/xxx or custom top-level dirs for mounts.

For example, I have /.share mounted to common NFS storage,
/.local mount --bind'ed to local (i.e. per-workstation) storage,
/mnt/auto is for automounter (local disk access, SMB etc)
and symlinks:
/usr -> /.share/usr
/home -> /.share/home
...
/tmp -> /.local/tmp
/var -> /.local/var
...

This works just fine for me.

--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/