Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-20-2013, 03:26 AM
|
#1
|
Member
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591
Rep:
|
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...
|
|
|
12-20-2013, 03:34 AM
|
#2
|
Member
Registered: Feb 2006
Location: Nederland
Distribution: slackware
Posts: 47
Rep:
|
|
|
|
12-20-2013, 08:38 AM
|
#3
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Just use a tmpfs, for example with
Code:
mount -t tmpfs tmpfs /mnt/ramdisk
This filesystem in RAM will always only occupy only the space that is actually used. By default it is limited to half the size of your RAM, but you can change that with the size mount option.
|
|
3 members found this post helpful.
|
12-20-2013, 09:19 PM
|
#4
|
Member
Registered: Aug 2010
Posts: 353
Rep: 
|
Why create something that already exists?
Code:
df -h | grep tmpfs
tmpfs 1,5G 12K 1,5G 1% /dev/shm
|
|
|
12-21-2013, 11:24 PM
|
#5
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Quote:
Originally Posted by MadMaverick9
Why create something that already exists?
Code:
df -h | grep tmpfs
tmpfs 1,5G 12K 1,5G 1% /dev/shm
|
/dev/shm has a very specific purpose (providing shared memory for inter-process communication). It makes sense to not use it for a different purpose, but rather to separate different use-cases, especially when it comes with virtually no costs to do so.
|
|
|
12-28-2013, 01:55 AM
|
#6
|
Member
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591
Original Poster
Rep:
|
Quote:
Originally Posted by TobiSGD
Just use a tmpfs, for example with
Code:
mount -t tmpfs tmpfs /mnt/ramdisk
This filesystem in RAM will always only occupy only the space that is actually used. By default it is limited to half the size of your RAM, but you can change that with the size mount option.
|
currently i use a addition to "append="... ramdisk_size=8192000" in lilo.conf, and
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?
|
|
|
12-28-2013, 02:21 AM
|
#7
|
Member
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875
|
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
|
|
|
12-28-2013, 07:09 AM
|
#8
|
Member
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591
Original Poster
Rep:
|
Quote:
Originally Posted by wildwizard
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
|
ok, thanks for clarification and some fun 
but what way i can use tmpfs? i must mount /dev/shm to /mnt/ramdisk or so on?
|
|
|
12-28-2013, 07:39 AM
|
#9
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
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.
|
|
|
12-28-2013, 08:14 AM
|
#10
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
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.
|
|
|
12-28-2013, 08:58 AM
|
#11
|
Member
Registered: Sep 2011
Posts: 925
|
Quote:
Originally Posted by jpollard
Fedora uses a tmpfs for /run
|
Slackware too. It doesn't show up in /etc/mtab, but just have a look at /proc/mounts.
Quote:
filling that filesystem causes services to fail, login failures, and OOM failures
|
That's what you can expect from quality Red Hat software.
|
|
|
12-28-2013, 11:22 AM
|
#12
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
Quote:
Originally Posted by jtsn
Slackware too. It doesn't show up in /etc/mtab, but just have a look at /proc/mounts.
|
I don't see it... /run is part of my root filesystem. Second, no user can write to /run anyway.
Quote:
That's what you can expect from quality Red Hat software.
|
I don't blame RH for that one (yet, I haven't tested their beta release). Some of their developers are a group of prima donnas in that even though they don't understand servers, that whatever they do is appropriate. They are also a bit ignorant of past technology... network analysis tools for ordering went out back in the 80s due to combinatorial explosion in complexity. Yet, they think they can get it to work reliably, and have foisted off an inherently unreliable init system.
|
|
|
12-28-2013, 01:03 PM
|
#13
|
Member
Registered: Sep 2011
Posts: 925
|
Quote:
Originally Posted by jpollard
I don't see it... /run is part of my root filesystem. Second, no user can write to /run anyway.
|
The mount is done in /etc/rc.d/rc.S:
Code:
# If /run exists, mount a tmpfs on it (unless the
# initrd has already done so):
if [ -d /run ]; then
if ! grep -wq "tmpfs /run tmpfs" /proc/mounts ; then
/sbin/mount -v -n -t tmpfs tmpfs /run -o mode=0755
fi
fi
Quote:
I don't blame RH for that one (yet, I haven't tested their beta release). Some of their developers are a group of prima donnas in that even though they don't understand servers, that whatever they do is appropriate.
|
As a business they are as successful as Microsoft in their respective field. You just do not need well-designed software from able developers to pull that off, that may even stand in the way of that business model.
Quote:
They are also a bit ignorant of past technology... network analysis tools for ordering went out back in the 80s due to combinatorial explosion in complexity. Yet, they think they can get it to work reliably, and have foisted off an inherently unreliable init system.
|
That is why stopped following the whole "technology" buzz (with programming language/framework of the week) and stay with Slackware (to get back on topic here). Some IT people think they can live without heritage, but IMHO making up stuff ad-hoc all the time is not a reputable profession. So one has to decide if he is either ignorant of the past or an IT professional. One can't be both.
|
|
|
12-29-2013, 07:10 AM
|
#14
|
Senior Member
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,908
|
Quote:
Originally Posted by jtsn
The mount is done in /etc/rc.d/rc.S:
Code:
# If /run exists, mount a tmpfs on it (unless the
# initrd has already done so):
if [ -d /run ]; then
if ! grep -wq "tmpfs /run tmpfs" /proc/mounts ; then
/sbin/mount -v -n -t tmpfs tmpfs /run -o mode=0755
fi
fi
|
Got it. At least slakware doesn't allow any user process access to it. That is where the problem lies.
Slackware is using /var/run (part of /var which is root) for what RH uses /run.
Quote:
As a business they are as successful as Microsoft in their respective field. You just do not need well-designed software from able developers to pull that off, that may even stand in the way of that business model.
|
I have no problem with some of what they do. SELinux, for instance, is a good thing to use to isolate one service from another, and from users. I'm not fond of the use of cgroups. There are good aspects, but also some bad side effects.
Quote:
That is why stopped following the whole "technology" buzz (with programming language/framework of the week) and stay with Slackware (to get back on topic here). Some IT people think they can live without heritage, but IMHO making up stuff ad-hoc all the time is not a reputable profession. So one has to decide if he is either ignorant of the past or an IT professional. One can't be both.
|
I intend to stay with slackware myself. I have been using RH/Fedora because that is what the workplace used. But I have been migrating back...
Last edited by jpollard; 12-29-2013 at 07:13 AM.
|
|
|
All times are GMT -5. The time now is 08:34 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|