Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I thought I had created a ramfs drive, but when I type df -H all I get is following.

Filesystem             Size   Used  Avail Use% Mounted on
/dev/sda5               69G   8.5G    57G  14% /
/dev/sdb3              2.8T   429G   2.3T  17% /home
/dev/sdb2               42G   6.8G    33G  18% /usr
/dev/sdb1               84G    12G    68G  15% /var
/dev/sda1              104M    37M    62M  38% /boot
/dev/sda3              1.1G   137M   853M  14% /tmp
tmpfs                  6.3G      0   6.3G   0% /dev/shm
tmpfs                  537M   9.8M   528M   2% /var/spool/exim/db
tmpfs                  537M    25k   537M   1% /home/stuff/output

That is listing the tmpfs drives, but not the ramfs drives (I created 2 of them). Does this mean that they weren't successfully created, or do I have to use a different command to list them?

share|improve this question
    
Well now I've found that they are listed if I type mount, but not from ds. What does that mean? –  Alasdair Dec 3 '11 at 4:28
    
First of all I am not aware of any command called ds. Do you mean to say df? –  Sachin Divekar Dec 3 '11 at 4:30
    
Yes, sorry... I meant df –  Alasdair Dec 3 '11 at 4:56
    
OK. Now can you post the steps you followed while creating and mounting the ram disk? –  Sachin Divekar Dec 3 '11 at 5:22
    
Like this: mount -t ramfs -o size=500m ramfs /home/testing/output –  Alasdair Dec 3 '11 at 5:58

1 Answer 1

up vote 1 down vote accepted

I tested it on my system. I observed the same behavior. You are right the ramfs was successfully created and will work. You can view it using df -a.

After some reading on the Internet to find the reason for this behavior. I have found that,

For a ramfs filesystem, the newer kernels report nothing back using "df". There is meant to be a patch for this (to allow for accounting in a ramfs). Philosophically, ramfs is mean to be as simple as possible, apparently, hence the lack of accounting. So data can be stored and used on the ramfs disk, but no accounting of it is possible, other than a loss of memory shown with "free". For this reason the tmpfs is better, since it does keep accounting and "df" shows what's going on.

There is a patch available for this. Google Keywords: df ramfs patch

You can find more information on Linux RAM-Based filesystems at the following link.

http://www.alper.net/linuxunix/linux-ram-based-filesystem/

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.