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

++wythern++

X presents Y for a better Z

[轉]在Linux下如何創建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 閱讀(1108) 評論(0)  編輯 收藏 引用


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   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| 国产精品乱看| 久久久综合视频| 裸体一区二区| 一区二区欧美精品| 亚洲欧美日韩精品| 在线观看亚洲视频| 亚洲国产免费看| 欧美剧在线免费观看网站| 亚洲午夜女主播在线直播| 亚洲欧美国产日韩中文字幕| 韩国一区二区三区美女美女秀| 久热精品视频在线| 欧美精品一区二区三区一线天视频| 亚洲素人一区二区| 久久精品天堂| 中文精品视频| 欧美中文在线观看| 亚洲精品乱码久久久久久蜜桃麻豆| 日韩视频一区二区三区在线播放| 国产三级精品三级| 亚洲黄色高清| 国产亚洲成精品久久| 欧美黄色视屏| 国产亚洲激情| 亚洲美女诱惑| 极品少妇一区二区三区| 一本久道久久久| 在线观看成人av| 亚洲综合日韩中文字幕v在线| 亚洲第一区色| 欧美一区二区三区免费视频| 日韩视频欧美视频| 久久久999精品| 亚洲女人小视频在线观看| 久久久噜噜噜久久人人看| 亚洲天堂激情| 欧美成人网在线| 久久久欧美一区二区| 国产精品视频一二| 亚洲精品久久在线| 在线欧美一区| 午夜精品久久久久久久99热浪潮 | 亚洲欧美日韩国产| 亚洲精品护士| 久久九九免费视频| 久久久国产视频91| 国产精品进线69影院| 亚洲精品无人区| 亚洲人成啪啪网站| 久久综合久久久久88| 久久久久久久久久久久久久一区| 欧美日韩一区在线视频| 亚洲欧洲日本专区| 91久久国产综合久久蜜月精品 | 欧美一级片一区| 亚洲综合三区| 欧美婷婷六月丁香综合色| 亚洲韩国日本中文字幕| 亚洲全部视频| 亚洲国产精品久久久久婷婷老年| 亚洲欧美中日韩| 欧美一级视频一区二区| 国产精品av免费在线观看| 一本色道久久综合亚洲精品不卡| 亚洲欧洲在线免费| 欧美gay视频激情| 欧美黑人在线观看| 亚洲国产一区二区a毛片| 老司机精品导航| 亚洲福利视频一区二区| 亚洲黄页一区| 欧美国产在线视频| 亚洲黄色一区| 99亚洲视频| 国产精品国产三级国产普通话蜜臀| 夜夜夜久久久| 亚洲欧美在线x视频| 国产欧美午夜| 久久久精品一品道一区| 欧美成人官网二区| 99精品热6080yy久久| 欧美日韩欧美一区二区| 亚洲一区3d动漫同人无遮挡| 欧美一区免费视频| 红桃视频国产一区| 欧美国产日产韩国视频| 亚洲最快最全在线视频| 久久九九精品99国产精品| 亚洲成在人线av| 欧美日韩黄视频| 亚洲欧美日韩在线不卡| 欧美国产免费| 亚洲少妇在线| 国色天香一区二区| 欧美久久一区| 午夜亚洲精品| 亚洲日本无吗高清不卡| 欧美在线一区二区三区| 亚洲精品国产精品国自产观看浪潮| 欧美日韩国内自拍| 久久久久高清| 亚洲午夜精品国产| 欧美丰满少妇xxxbbb| 午夜久久黄色| 亚洲黄一区二区三区| 国产乱码精品一区二区三区五月婷| 久久综合色88| 亚洲嫩草精品久久| 亚洲精品美女91| 久久亚洲电影| 亚洲欧美卡通另类91av| 亚洲福利在线看| 国产精品久久久免费| 女仆av观看一区| 久久成人在线| 日韩一级在线观看| 91久久精品久久国产性色也91| 久久精品国产91精品亚洲| 中文国产成人精品| 亚洲精品久久久久久久久| 含羞草久久爱69一区| 国产嫩草影院久久久久| 欧美日韩成人综合| 欧美大尺度在线观看| 久久久久久久久久久成人| 香蕉免费一区二区三区在线观看 | 99视频精品免费观看| 欧美成人网在线| 久久久九九九九| 欧美一区二区高清| 亚洲制服少妇| 亚洲一二三区视频在线观看| 亚洲毛片在线看| 亚洲激情av在线| 亚洲国产天堂久久国产91| 好吊色欧美一区二区三区视频| 国产精品欧美一区喷水| 国产精品xxxav免费视频| 欧美日韩精品中文字幕| 欧美日本高清视频| 欧美日韩国产专区| 欧美日韩1区2区3区| 欧美片第一页| 欧美午夜视频| 国产精品久久一卡二卡| 国产精品成av人在线视午夜片| 欧美午夜国产| 国产精品―色哟哟| 国产视频在线一区二区| 国产专区综合网| 悠悠资源网久久精品| 亚洲国产1区| 亚洲欧洲免费视频| 一本色道久久综合亚洲精品小说 | 亚洲专区在线| 午夜国产精品影院在线观看| 午夜天堂精品久久久久| 久久不射网站| 免费在线观看日韩欧美| 亚洲第一中文字幕| 日韩视频在线一区| 亚洲在线播放| 久久久精品欧美丰满| 欧美大香线蕉线伊人久久国产精品| 免费看精品久久片| 欧美日韩精品久久| 国产亚洲成av人片在线观看桃| 在线看不卡av| 亚洲在线一区二区| 久久亚洲春色中文字幕| 亚洲欧洲另类国产综合| 亚洲一区二区精品| 久久先锋影音| 欧美视频久久| 亚洲电影免费观看高清完整版在线| 亚洲精品在线二区| 欧美伊人影院| 亚洲激情av在线| 午夜久久99| 欧美日韩精品| 一区二区三区我不卡| 亚洲一区二区三区中文字幕在线 | 久久精品在这里| 亚洲日本电影| 久久婷婷麻豆| 国产精品男女猛烈高潮激情 | 欧美日韩伦理在线免费| 黄色成人av网站| 亚洲一区在线直播| 蜜臀av性久久久久蜜臀aⅴ四虎| 亚洲精品在线看| 久久五月激情| 国产视频观看一区|