LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 12-20-2013, 03:26 AM   #1
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591

Rep: Reputation: 73
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...
 
Old 12-20-2013, 03:34 AM   #2
fietser
Member
 
Registered: Feb 2006
Location: Nederland
Distribution: slackware
Posts: 47

Rep: Reputation: 7
https://www.google.nl/search?q=creat...HaiO0AWjpoC4Dg

Have fun.
 
Old 12-20-2013, 08:38 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
Old 12-20-2013, 09:19 PM   #4
MadMaverick9
Member
 
Registered: Aug 2010
Posts: 353
Blog Entries: 4

Rep: Reputation: Disabled
Why create something that already exists?
Code:
df -h | grep tmpfs
tmpfs           1,5G   12K  1,5G   1% /dev/shm
 
Old 12-21-2013, 11:24 PM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by MadMaverick9 View Post
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.
 
Old 12-28-2013, 01:55 AM   #6
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591

Original Poster
Rep: Reputation: 73
Quote:
Originally Posted by TobiSGD View Post
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?
 
Old 12-28-2013, 02:21 AM   #7
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
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
 
Old 12-28-2013, 07:09 AM   #8
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591

Original Poster
Rep: Reputation: 73
Quote:
Originally Posted by wildwizard View Post
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?
 
Old 12-28-2013, 07:39 AM   #9
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
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.
 
Old 12-28-2013, 08:14 AM   #10
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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.
 
Old 12-28-2013, 08:58 AM   #11
jtsn
Member
 
Registered: Sep 2011
Posts: 922

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
Quote:
Originally Posted by jpollard View Post
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.
 
Old 12-28-2013, 11:22 AM   #12
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by jtsn View Post
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.
 
Old 12-28-2013, 01:03 PM   #13
jtsn
Member
 
Registered: Sep 2011
Posts: 922

Rep: Reputation: 480Reputation: 480Reputation: 480Reputation: 480Reputation: 480
Quote:
Originally Posted by jpollard View Post
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.
 
Old 12-29-2013, 07:10 AM   #14
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Quote:
Originally Posted by jtsn View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Squeeze: Simplest method to create a 5MB Ramdisk? patrick295767 Debian 3 08-09-2012 10:27 AM
Cant create ramdisk in cblfs grumpy.biatch Linux From Scratch 9 02-02-2011 07:39 AM
RAMDISK: couldn't find valid ramdisk image starting at 0. iotc247 Slackware 10 12-10-2010 03:08 PM
howto create linux to boot from ramdisk only?? pingvina Linux - Software 2 02-09-2006 01:17 PM
kernel build create initial ramdisk htamayo Linux - Software 1 01-07-2005 01:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 04:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration