Creating a RamDisk

I use openSuse 11 on Hp Laptop with 4 Gig Ram and I want to create a RamDisk for 1 GB out of it and also I want this space to exclusively reside in Ram and not supposed to be swapped to disc even when the OS runs into memory pressure.

I found this article (Linux Ramdisk mini-HOWTO) which exactly address my need but its for RedHat, it would be great if any could help out in doing the same for in our openSuse 11.

appreciate your time and help….

Thanks.
Kent

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don’t see a single reason why that wouldn’t work for SUSE. Linux is
Linux, largely.

Good luck.

oracle123 wrote:
> I use openSuse 11 on Hp Laptop with 4 Gig Ram and I want to create a
> RamDisk for 1 GB out of it and also I want this space to exclusively
> reside in Ram and not supposed to be swapped to disc even when the OS
> runs into memory pressure.
>
> I found this article (‘Linux Ramdisk mini-HOWTO’
> (http://www.vanemery.com/Linux/Ramdisk/ramdisk.html)) which exactly
> address my need but its for RedHat, it would be great if any could help
> out in doing the same for in our openSuse 11.
>
> appreciate your time and help….
>
> Thanks.
> Kent
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJKjzX3s42bA80+9kRAubtAJ0dG1O40W/IdmAe9Hsdj/9/TQf3NACeJDga
UQR/qA6Hwwo/7r5tFd5N68E=
=cJCg
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This is also interesting:

http://www.thegeekstuff.com/2008/11/overview-of-ramfs-and-tmpfs-on-linux/#more-251

Good luck.

ab@novell.com wrote:
> I don’t see a single reason why that wouldn’t work for SUSE. Linux is
> Linux, largely.
>
> Good luck.
>
>
>
>
>
> oracle123 wrote:
>> I use openSuse 11 on Hp Laptop with 4 Gig Ram and I want to create a
>> RamDisk for 1 GB out of it and also I want this space to exclusively
>> reside in Ram and not supposed to be swapped to disc even when the OS
>> runs into memory pressure.
>
>> I found this article (‘Linux Ramdisk mini-HOWTO’
>> (http://www.vanemery.com/Linux/Ramdisk/ramdisk.html)) which exactly
>> address my need but its for RedHat, it would be great if any could help
>> out in doing the same for in our openSuse 11.
>
>> appreciate your time and help&.
>
>> Thanks.
>> Kent
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJKkES3s42bA80+9kRAj99AJ9eflCAI4ovd/ptumZ+B9WYkoMi4wCcCdQv
oiHp3fR4pKo+fi9cqhEABs0=
=Te9I
-----END PGP SIGNATURE-----

Look at the **man **page for **mount. **Read the paragraphs on ‘Mount options for ramfs’ and ‘Mount options for tmpfs’. Together with the information in the link mentioned by ab@novell you should be up to date.

Perfect Solution dude, Thanks a ton for the help offered to me…

using the below two commands i can mount a tmpfs when logged in as root

mkdir -p /mnt/tmp

mount -t tmpfs -o size=20m tmpfs /mnt/tmp

Since i also want this to be automatically mounted to all other users who log in to this system, so after some googling i found (src/share/examples/fstab/fstab.tmpfs - view - 1.2) and added “tmpfs /tmp tmpfs rw,-s128M” to the end of ‘fstab’, but the result were not fruitful for me…

Can you help me to mount a one at the boot for all users on this machine…

thanks again pro…

Kent

First, onc you have created the mountpoint (in your case mnt/tmp) you do not have to recreate it every time (as long as you do not **rmdir **it).

Second, you can make it rwx to everybody by

chmod a+rwx /mnt/tmp

Again only needed once.

Third, when you put the parameters in /etc/fstab, it will be mounted at boot (as you already are aware of). Just add the same parameters in a bit different succession (see man fstab) as you use when mounting by hand:

tmpfs /mnt/tmp tmpfs size=20m,rw

The rw is not needed (it is the default), but it does no harm and will document to yourself that you wanted it rw whatever the default :slight_smile:

Great !!! It worked as expected…

thanks a ton :slight_smile: