LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-29-2011, 04:20 PM   #1
SelymmyleS
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Rep: Reputation: Disabled
Mounting USB-attached SSD as tmpfs


Greetings from Massachusetts, USA! First post here.

A colleague insists that a USB-attached SSD can be mounted as tmpfs, so I did a test with a 127 GiB Iomega USB-attached SSD:

Code:
/dev/sdba on /x type tmpfs (rw,noatime,nodiratime,size=127G)
While the mount command succeeds, I'm almost certain the "filesystem" is actually backed by RAM and swap, not the SSD.

I tried coping a large (4 GiB) file to the tmpfs-mounted filesystem:

Code:
cp /some/bigfile /x
From another terminal, I ran:

Code:
iostat /dev/sdba 7
This showed zero I/O on the SSD block device:
Code:
Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sdba              0.00         0.00         0.00          0          0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.00    0.12    0.00   99.88

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sdba              0.00         0.00         0.00          0          0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.00    0.13    0.00   99.87

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sdba              0.00         0.00         0.00          0          0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.00    0.50    0.00   99.50

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sdba              0.00         0.00         0.00          0          0

avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.00    0.00    0.00    0.00    0.00  100.00

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn
sdba              0.00         0.00         0.00          0          0
This seems to prove my hypothesis that the tmpfs is not backed by the SSD. However, this colleague has a system where the amount of data stored on an (allegedly) SSD-back tmpfs exceeds available RAM and swap. What gives? Can you really mount a tmpfs that's backed by SSD?

Thanks for reading, and thanks for any comments.

All the best,
Myles
 
Old 11-29-2011, 10:05 PM   #2
MS3FGX
LQ Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 357Reputation: 357Reputation: 357Reputation: 357
As the name implies "tmpfs" is a temporary filesystem created in volatile storage (I.E. RAM). There is no such thing as a "backed" tmpfs volume, as that would then be a normal filesystem; completely defeating the purpose.

In the case of a tmpfs volume exceeding the amount of physical RAM, you have to keep in mind that a tmpfs volume doesn't actually take up any more space than what is being used. So you could create a 10 GB tmpfs volume on a machine with only 64 MB of free RAM...so long as you don't use more than 64 MB of RAM. If you do use more space than you have free RAM, the system will dip into the swap file/partition. If that happens, the advantage of tmpfs (high performance) is again lost, as the physical disk drive will be involved.

Your friend is very much mistaken, and is probably seeing poorer performance than he should because of it.
 
1 members found this post helpful.
Old 11-29-2011, 10:42 PM   #3
SelymmyleS
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for your reply.

I guess the "mount" command ignores the "/dev/sdba" part (the block device file representing the SSD), even though it's shown here:

Code:
[user@host ~]$ mount | grep '^\/dev\/sdba'
/dev/sdba on /some/where type tmpfs (rw,noatime,nodiratime,size=127G)
This particular tmpfs is 127 GiB...

Code:
[user@host ~]$ df -h /dev/sdba
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdba             127G   17G  111G  13% /some/where
...and the machine has about 66 GiB of combined swap and physical memory.

Code:
[user@host ~]$ /sbin/swapon -s
Filename				Type		Size	Used	Priority
/dev/cciss/c0d0p5                       partition	2048248	198908	-1
Code:
[user@host ~]$ cat /proc/meminfo | grep '^MemTot'
MemTotal:     64973272 kB
So, if this particular tempfs grows beyond the amount of available memory (physical plus swap), I assume the machine will be in a sorry state. Is this correct? In other words, this tmpfs exists in RAM and swap only, and has absolutely nothing to do with /dev/sdba (the SSD).

Thanks again for taking the time to reply!

Myles
 
Old 11-29-2011, 11:36 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853Reputation: 4853
I wonder where you got that strange device descriptor from. /dev/sdba is not a correct path to any of your devices.

Quote:
this tmpfs exists in RAM and swap only, and has absolutely nothing to do with /dev/sdba (the SSD).
Correct.
 
1 members found this post helpful.
Old 11-29-2011, 11:44 PM   #5
SelymmyleS
LQ Newbie
 
Registered: Nov 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
I wonder where you got that strange device descriptor from. /dev/sdba is not a correct path to any of your devices.
Tobi,

/dev/sdba is, in fact, the USB-attached SSD. This is what happens when a system has more than 26 "SCSI" block devices attached (/dev/sd[a-z])!

Thanks for taking the time to reply!

Myles
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reducing writes to SSD: mounting /var (and others) on RAM disks (tmpfs). sysfce2 Slackware 7 08-26-2011 03:00 AM
help w/ linuxrc and mounting tmpfs after netboot rrlangly Linux - General 1 05-25-2010 07:36 PM
LXer: Speed up Firefox by mounting the profile in tmpfs (RAM) [Linux only] LXer Syndicated Linux News 0 05-04-2009 10:11 AM
Using Fedora 7: Trouble Mounting a USB Attached Fedora 7 Drive SysConWatch Linux - Newbie 6 11-12-2007 07:15 PM
Mounting /var/log as a tmpfs mr666white Linux - Laptop and Netbook 2 12-06-2004 09:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:54 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration