create ramdisk in slack 14 ?
Hello!
Maybe anyone have an instruction, why i can create a ramdisk on slackware64 14.0, and use it as a "normal" disk partition? thanks... |
|
Just use a tmpfs, for example with
Code:
mount -t tmpfs tmpfs /mnt/ramdisk |
Why create something that already exists?
Code:
df -h | grep tmpfs |
Quote:
|
Quote:
mkfs-t ext2 -q /dev/ram1 8192000 mount /dev/ram1 /mnt/ramdisk in rc.local why tmpfs is better than this? i have a 16 Gb RAm on that machine, and 8 Gb ramdisk is sufficient for my purposes. also, maybe anyone can explain, in what ways /dev/ram0 differ from /dev/ram1 / ram2 and so on? |
tmpfs/ramfs will be faster than the old (ramdisk) code, see here :-
https://www.kernel.org/doc/Documenta...-initramfs.txt tmpfs and ramfs work the same way but have minor differences eg :- ramfs can grow tmpfs can be swapped tl;dr ramdisk - old bad ramfs/tmpfs - new good |
Quote:
but what way i can use tmpfs? i must mount /dev/shm to /mnt/ramdisk or so on? |
No, you don't mount /dev/shm. /dev/shm has a very specific purpose and I wouldn't use it for other things. You can just mount a new tmpfs (tmpfs is a virtual filesystem) to any directory you want. For example, on my main machine I mount a tmpfs to /tmp on boot, so that all actions in /tmp automatically run on a RAM-disk.
|
The only downside I know of with tmpfs is that there are no quota controls possible on it.
A user/process may fill tmpfs using up the amount of memory the mount is limited to (1/2 ram by default). Using several such mounts allows a DOS attack (inadvertent OOM) that can't be avoided. Fedora uses a tmpfs for /run - filling that filesystem causes services to fail, login failures, and OOM failures. It is sort of reasonable for workstations, but very limited for servers (the use for shared memory is the only reasonable use I know of) as it allows users the ability to wipe out the usability of the system. |
Quote:
Quote:
|
Quote:
Quote:
|
Quote:
Code:
# If /run exists, mount a tmpfs on it (unless the Quote:
Quote:
|
Quote:
Slackware is using /var/run (part of /var which is root) for what RH uses /run. Quote:
Quote:
|
All times are GMT -5. The time now is 02:07 PM. |