青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

++wythern++

X presents Y for a better Z

[轉(zhuǎn)]在Linux下如何創(chuàng)建ramdisk

Refer to How to Easily Create Ramdisk on Linux

This tutorial will show you how to quickly create a RAM disk in any Linux distro (Debian, Ubuntu, Linux, Fedora, Arch Linux, CentOS, etc). Compared to commercial Windows RAM disk software that costs money, Linux can utilize this cool feature 100% free of charge.

What is RAM Disk?

RAM disk is also known as RAM drive. It’s a portion of your RAM that are formated with a file system. You can mount it to a directory on your Linux system and use it as a disk partition.

Why use RAM disk?

RAM is ultra-fast compared to even the fastest solid state drive (SSD). As you may know, the main performance bottleneck in today’s computer is the speed of hard drive, so moving programs and files to the RAM disk yields super fast computing experience.

Pros of RAM disk:

  • Ultra-fast
  • Can sustain countless reads and writes

Cons of RAM disk:

  • RAM is volatile which means all data in RAM disk will be lost when the computer shutdowns or reboots. However, this can be a pro in some situations, if you use it wisely.
  • RAM is expensive so it has limited capacity. You need to make sure not allocate too much space for RAM disk, or the operating system would run out of RAM.

You can do a lot of interesting things with RAM disk.

  • RAM disk is best suited for temporary data or caching directories, such as Nginx FastCGI cache. If you use a SSD and there will be a lot of writes to a particular directory, you can mount that directory as a RAM disk to reduce wear out of SSD.
  • I also use RAM disk to temporary store screenshots when writing articles on this blog, so when my computer shut down, those screenshots will automatically be deleted on my computer.
  • You may not believe it, but I use RAM disk to run virtual machines inside VirtualBox. My SSD is about 250G. I can’t run many VMs directly on the SSD and I’m not happy about the speed of my 2TB mechanical hard drive (HDD). I can move the VM from HDD to RAM disk before starting the VM, so the VM can run much faster.  After shutting down the VM, I move the VM files back to HDD, which takes less than 1 minute. This of course requires your computer to have a large capacity RAM.

How to Create a RAM Disk in Any Linux Distro

First make a directory which can be anywhere in the file system such as

sudo mkdir /tmp/ramdisk

If you want to let every user on your Linux system use the RAM disk, then change its permission to 777.

sudo chmod 777 /tmp/ramdisk

Next, check how much free RAM are left on your system with htop command line utility because we don’t want to use too much RAM.

htop

easily create ram disk linux

Then all left to do is to specify the file system typeRAM disk sizedevice name and mount it to the above directory. You can see from the screenshot above that I have plenty of free RAM, so I can easily allocate 1GB for my RAM disk. This can be done with the following one-liner. It will be using tmpfs file system and its size is set to 1024MB. myramdisk is the device name I gave to it.

sudo mount -t tmpfs -o size=1024m myramdisk /tmp/ramdisk

To allocate 10G for the RAM disk, run this instead.

sudo mount -t tmpfs -o size=10G myramdisk /tmp/ramdisk

If we issue the following command

mount | tail -n 1

We can see it’s successfully mounted.

create linux ramdisk

Now if I copy my VirtualBox machines file (5.8G) into the RAM disk, my RAM usage suddenly goes up to 9.22G.

linux automount ramdisk

If I unmount RAM disk,

sudo umount /tmp/ramdisk/

Everything in that directory will be lost and RAM usage goes down to original.

linux ramdisk file system

This is how you can test if your RAM disk is working.

Test RAM Disk Speed

To test write speed of RAM disk, you can use dd utility.

sudo dd if=/dev/zero of=/tmp/ramdisk/zero bs=4k count=100000

Which gave me 2.8GB/s write speed.

linux ramdisk speed test

To test read speed, run:

sudo dd if=/tmp/ramdisk/zero of=/dev/null bs=4k count=100000

Which gave me 3.1 GB/s read speed.

I also did a speed test on my SSD. The write speed is 534MB/s and read speed 1.6GB/s.

Auto-mount on System Boot

Edit /etc/fstab file.

sudo nano /etc/fstab

Add an entry like this:

myramdisk  /tmp/ramdisk  tmpfs  defaults,size=1G,x-gvfs-show  0  0

x-gvfs-show will let you see your RAM disk in file manager. Save and close the file. Your Linux system will automatically mount the RAM disk when your computer boots up.

To mount it immediately without reboot, run the following command.

sudo mount -a

posted on 2020-02-26 15:17 wythern 閱讀(1093) 評(píng)論(0)  編輯 收藏 引用


只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            国产伦精品一区二区三区免费| 欧美精品一区二区精品网| 欧美色偷偷大香| 一区二区三区高清视频在线观看 | 在线成人www免费观看视频| 久久精品亚洲精品| 久久久亚洲人| 中文高清一区| 欧美一区二区三区久久精品茉莉花 | 欧美日韩中文另类| 亚洲综合第一页| 午夜国产精品影院在线观看| 黑人操亚洲美女惩罚| 欧美韩日亚洲| 国产精品国产亚洲精品看不卡15| 午夜精品影院| 蜜桃久久av一区| 亚洲性av在线| 久久夜色精品国产欧美乱极品| 亚洲精品美女久久7777777| 一区二区三区日韩精品视频| 国一区二区在线观看| 亚洲国产天堂久久综合网| 欧美视频在线一区二区三区| 久热精品视频在线| 欧美日韩免费看| 欧美午夜久久| 欧美精品高清视频| 久久青草欧美一区二区三区| 鲁大师成人一区二区三区| 国产精品中文字幕欧美| 欧美国产一区二区在线观看| 国产精品理论片在线观看| 欧美成人午夜| 国产欧美一区二区精品仙草咪 | 日韩视频在线观看国产| 亚洲欧美成aⅴ人在线观看| 亚洲精品一区二区三区99| 香蕉成人啪国产精品视频综合网| 亚洲精品国产精品久久清纯直播| 欧美亚洲午夜视频在线观看| 亚洲一区二区三区欧美| 男男成人高潮片免费网站| 久久亚洲风情| 国产精品一区二区你懂的| 99精品国产在热久久婷婷| 最近中文字幕mv在线一区二区三区四区| 亚洲视频axxx| 亚洲一线二线三线久久久| 欧美肥婆bbw| 欧美激情黄色片| 韩国成人精品a∨在线观看| 亚洲欧美日韩天堂一区二区| 国产精品99久久久久久人| 欧美大片91| 亚洲第一在线视频| 亚洲激情视频在线播放| 久久久久**毛片大全| 久久噜噜亚洲综合| 激情av一区二区| 久久免费国产精品| 免费观看成人| 亚洲国产天堂久久综合网| 蜜桃av一区| 欧美激情欧美狂野欧美精品| 亚洲激情电影在线| 欧美成人一区二区三区片免费| 欧美成ee人免费视频| 在线欧美日韩| 你懂的成人av| 日韩视频精品| 亚洲欧美日韩区| 国产伦精品一区二区三区在线观看 | 欧美精品一区二区三区一线天视频| 欧美国产欧美亚洲国产日韩mv天天看完整 | 国产精品qvod| 亚洲欧美日韩国产| 久久先锋资源| 亚洲精品视频在线播放| 欧美日韩国产成人在线91| 一本久久综合亚洲鲁鲁五月天| 亚洲一区美女视频在线观看免费| 国产精品女主播一区二区三区| 欧美一区二区三区日韩视频| 老色批av在线精品| 日韩亚洲欧美综合| 国产精品亚洲美女av网站| 久久aⅴ乱码一区二区三区| 欧美国产丝袜视频| 亚洲专区欧美专区| 激情成人综合网| 欧美激情一区二区三区在线 | 亚洲大胆美女视频| 亚洲一区二区在线视频| 国内揄拍国内精品久久| 欧美成人首页| 午夜免费在线观看精品视频| 亚洲电影专区| 久久精品国产99精品国产亚洲性色| 亚洲第一精品夜夜躁人人爽 | 蜜臀a∨国产成人精品| 一区二区三区精品国产| 美女啪啪无遮挡免费久久网站| 亚洲伦理在线免费看| 国产日韩欧美一区二区三区在线观看| 久久久国产成人精品| 一本色道久久综合亚洲精品按摩| 久久久久久网| 香蕉成人伊视频在线观看| 91久久国产综合久久91精品网站| 国产精品嫩草99av在线| 欧美大片91| 久久九九热re6这里有精品| 亚洲免费成人| 亚洲电影免费在线观看| 久久久久久网站| 亚洲综合清纯丝袜自拍| 日韩网站在线观看| 在线日韩中文字幕| 海角社区69精品视频| 国产精品午夜国产小视频| 欧美精品久久一区二区| 免费一级欧美片在线播放| 午夜精品短视频| 99精品国产高清一区二区| 亚洲国产成人av好男人在线观看| 欧美中文字幕不卡| 亚洲欧美一区二区激情| 亚洲视频中文| 中文日韩在线| 一区二区三区产品免费精品久久75| 亚洲国产专区| 91久久极品少妇xxxxⅹ软件| 在线不卡欧美| 亚洲福利视频二区| 在线国产精品一区| 影音国产精品| 黄色影院成人| 影音先锋一区| 亚洲电影免费在线 | 国内精品久久久久久久影视蜜臀| 国产精品久久久久久久久免费| 欧美日一区二区三区在线观看国产免| 欧美精品18| 欧美日韩亚洲激情| 欧美日韩精品| 国产精品久久久久久久久久久久久久| 欧美午夜女人视频在线| 国产精品国产三级国产aⅴ浪潮| 欧美日韩在线播放| 国产精品欧美久久| 国产午夜精品视频| 一区二区三区在线免费视频| 亚洲第一中文字幕| 亚洲另类黄色| 亚洲综合视频1区| 久久精品一区四区| 欧美成人一区二区三区| 亚洲国产精品va在线看黑人动漫| 亚洲国产精品成人综合色在线婷婷| 91久久在线播放| 亚洲天堂av在线免费| 欧美在线播放| 欧美成人a∨高清免费观看| 欧美日韩日本国产亚洲在线| 国产精品毛片高清在线完整版| 国产精品揄拍500视频| 在线日韩欧美视频| 亚洲自拍偷拍网址| 开心色5月久久精品| 亚洲激情午夜| 欧美亚洲一区二区在线| 免费不卡在线观看| 国产精品美女一区二区| 在线看片成人| 亚洲影院污污.| 猛干欧美女孩| 一区二区三区高清| 久久人人精品| 国产精品三级视频| 亚洲美女诱惑| 久久精品国产99国产精品| 亚洲精品一区二区三区四区高清 | 日韩亚洲欧美一区二区三区| 欧美一区日韩一区| 欧美另类视频在线| 怡红院精品视频| 午夜精品影院在线观看| 亚洲国产欧美一区二区三区丁香婷| 亚洲线精品一区二区三区八戒| 男人的天堂成人在线| 欧美成人精品在线观看| 亚洲已满18点击进入久久| 欧美电影在线观看完整版| 国模套图日韩精品一区二区| 亚洲一区二区免费视频| 亚洲激情校园春色| 老鸭窝亚洲一区二区三区| 国产一区三区三区| 午夜视频在线观看一区|