About meDashed CMS RSS
Kuragramming of beard
 
 
 /Root/Articles/

Create a RAM disk in Ubuntu

02.11.2011 10:03:56 Sometimes there is a need to create a virtual disk in RAM. It is often necessary to speed up some file operations, the benefit of our time will not surprise a lot of RAM. In general, I will not drag out ...
To create a RAM disk in memory there are two ways (in Linux)
1) Creating a firmly fixed in memory:
sudo mkfs-t ext2-q / dev/ram1 64M
sudo mkdir-p /media/ram
sudo mount /dev/ram1/ /media/ram -o defaults, rw
sudo chmod-R 777/media/ram
Unfortunately I could not get a drive larger than 64 megabytes, do not even know what it is connected. As is evident from the first line we have used the file system ext2, I did not use ext3 journaling as a virtual disk just an extra loss in speed, in the first line we format the device, create a second folder in the right place, you can even radically, I it easier to media, because there appears. In the third row, we mount the device in the fourth set right because of all created under the root, then if we do not, there will not be able to write anything. Way to unmount the partition to use sudo umount/media/ram, and do not forget to delete the folder sudo rmdir/media/ram, otherwise it will remain a lie waste
2) There is another way it is more flexible and easier, but I did not like
sudo mkdir/dev/shm/RAMtmp/
sudo chmod 777 /dev/shm/RAMtmp/
sudo mount-t tmpfs-o size=64M tmpfs/dev/shm/RAMtmp
The difference is that in case of overload of RAM disk will fall into the swap file on the one hand is a plus, minus, on the other, and yet that well with this approach increases the memory which is quite advantageous to gradually


Now I have described only how to create dynamic virtual disk in memory, because I have no need to get my memory ever eaten.
To drive was created at the start of the system is a completely different way with fstab, this may be I will write another article, I repeat can be:)

Рейтинг $r-- [1] $r++

Показать коментарии (vkontakte.ru)
}