---
title: 'Creating a RAM disk in Linux to speed up Mozilla Firefox'
url: 'https://ra1ahq.blog/en/uskorenie-mozilla-firefox-pri-pomoshi-ram-diska'
markdown: 'https://ra1ahq.blog/en/uskorenie-mozilla-firefox-pri-pomoshi-ram-diska.md'
lang: en
date: '2022-06-16'
description: 'At home I have a computer without an SSD drive, but with a lot of random access memory (RAM). I came up with a way to speed up the work - you need to use a RAM disk in Linux! Creati'
taxonomy:
  category:
    - blog
  tag:
    - firefox
  archives_month:
    - jun_2022
  archives_year:
    - '2022'
---

16 

 June 

 2022 

 ![Creating a RAM disk in Linux to speed up Mozilla Firefox](https://ra1ahq.blog/images/6/6/e/d/3/66ed3c425a8d79f5a1f96ffa362882fcab3baa64-ramdisk.png)17:01

### Creating a RAM disk in Linux to speed up Mozilla Firefox

 [firefox](https://ra1ahq.blog/en/tag:firefox) 

16 June 2022 17:01

At home I have a computer without an SSD drive, but with a lot of random access memory (RAM). I came up with a way to speed up the work - you need to use a RAM disk in Linux!

### Creating a RAM Disk in Linux

Unlike Windows, no third party programs are required.

1\) First of all, let’s create a subdirectory in the TMP folder, which we’ll call ramdisk:

```
sudo mkdir /tmp/ramdisk
```

2\) Give full rights to all users to read, change, execute:

```
sudo chmod 777 /tmp/ramdisk
```

3\) Let's check how much free memory is available

```
free -h
```

In my case, I will allocate 1GB of RAM.

4\) Create a RAM disk, size 1024m, file system type tmpfs, device name ramdisk, to the path /tmp/ramdisk:

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

### Configuring Mozilla Firefox to use RAM disk

We configure Firefox so that it uses our ramdisk to store temporary files (cache) on disk:

- launch Firefox

1\) Enter in the address bar **about:config** and press the Enter key

We agree that we understand the risk and continue.

2\) Add a string parameter

**browser.cache.disk.parent\_directory**

and confirm with the Enter key.

Click **\[+\]** we add a value to it - our temporary directory in RAM:

**/tmp/ramdisk**

We complete the assignment of the value with the Enter key.

3\) Restart the browser.

We evaluate how the speed of work has increased. If you go to the /tmp/ramdisk folder, you can see that the browser has created temporary files in it - it uses the cache, but not on the disk, but in RAM.

### Creating a permanent RAM disk using the /etc/fstab file

In order for the RAM disk to be created when the OS boots, you need to edit the system file /etc/fstab

At the end of which I added the lines:

# Entry for RAM disk

```
ramdisk           /tmp    tmpfs   defaults       0       0
```

where:
**ramdisk**- parameter No. 1 -**device name**
**/tmp**- parameter No. 2,**file system mount point**
**tmfs**- parameter No. 3,**file system type - tmpfs**
**defaults**- parameter No. 4, value **defaults**, which replaces the list of options: rw, suid, dev, exec, auto, nouser, async and relatime.
I did not specify the size size=4g in order to speed up the OS at the same time as Mozilla Firefox - the /tmp/ mount point for temporary files.
0- parameter No. 5, do not use for the backup utility
0- parameter No. 6, do not use for the fsck disk check option

If desired, the size of the RAM disk can be limited, instead **defaults** indicate **defaults,size=4g**

Result of the mount command:

- with a disk size limit of 4GB:
    ![result 4G](https://ra1ahq.blog/images/e/e/9/b/b/ee9bbf76eaf1abc0dc40f4ca440be66e71699834-result.png "result 4g")
- RAM disk without restrictions:
    ![realtime](https://ra1ahq.blog/images/7/d/2/e/1/7d2e1742dbc9873d0a45b3b36007eb8f91fd918f-realtime.png "realtime")

### Speed comparison

**Regular HDD**

\*Write speed

```
cd ~
sync; dd if=/dev/zero of=tempfile bs=1M count=1024; sync
```

1024+0 records received
1024+0 entries sent
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 10.4092 s, 103 MB/s

- Reading speed

    sudo sh -c "sync && echo 3 > /proc/sys/vm/drop\_caches"
    sync; dd if=~/tempfile of=/dev/null bs=100k; sync

10485+1 records received
10485+1 entries sent
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 7.24557 s, 148 MB/s

**RAM disk**

\*Writing speed:
cd /tmp/ramdisk
sync; dd if=/dev/zero of=tempfile bs=1M count=1024; sync

1024+0 records received
1024+0 entries sent
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.32374 s, 811 MB/s

8 times faster writing to RAM.
dd if=./tempfile of=/dev/null bs=4k

- Reading speed:
    sudo sh -c "sync && echo 3 > /proc/sys/vm/drop\_caches"
    dd if=./tempfile of=/dev/null bs=100k

0485+1 records received
10485+1 entries sent
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.347437 s, 3.1 GB/s

On my PC, the writing speed to RAM is 811/103=8 times higher, the reading speed from RAM is 3100/103=30 times higher! On server motherboards with multi-channel memory and fast DDR4 RAM modules, the benefits from using a RAM disk should be even more significant.

The test used a WDC WD5000AZLX-2 hard drive, RAM 2 DIMM DDR3 1333 MHz (0.8 ns), product: R53 **8G** 1601S2S on the BIOSTAR Group J1800NH3 motherboard.

The advantage of storing the Mozilla Firefox cache on a RAM disk is that the browser cache is automatically cleared after the PC is turned off.

---

**Links:**

*[How to change the default cache folder for firefox?](https://support.mozilla.org/en-US/questions/1066350)- Mozilla Support* [How to Easily Create RAM Disk on Debian, Ubuntu, Linux Mint, CentOS](https://www.linuxbabe.com/command-line/create-ramdisk-linux)-

LinuxBabe.
*[How to measure hard drive speed](https://serveradmin.ru/kak-izmerit-skorost-zhestkogo-diska/)- serveradmin.ru* [Using tmpfs to speed up the OS a little](https://the-bosha.ru/2010/01/20/tmpfs/)- the-bosha.ru
\*[Testing read/write speed for devices...](http://rus-linux.net/MyLDP/consol/test-usb-drives.html)- rus-linux.net

### Related publications

 [ ![](https://ra1ahq.blog/images/c/d/1/b/a/cd1ba6390f15bdb4cbf899d5dc57e5acdc845984-secur.png) Checklist for checking your web browser before visiting sites that collect information about visitors ](https://ra1ahq.blog/en/cheklist-dlya-proverki-veb-brauzera-pered-posesheniem-saitov-sobirayushikh-informaciyu-o-posetitelyakh) 

 [ ![](https://ra1ahq.blog/images/1/b/0/0/a/1b00a6c9b18d3aecd990a333d8e1e1a0af534b04-ff-nightly.png) Замена веб-браузеров Firefox и Firefox ESR на Firefox-Nightly ](https://ra1ahq.blog/en/zamena-veb-brauzera-firefox-esr-na-firefox-nightly) 

 [ ![](https://ra1ahq.blog/images/b/d/6/1/b/bd61bb0015f4327e7404df5cfbe1f73003cb8ccf-aquarium.webp) Enabling Mozilla Firefox to support the EGL API for hardware graphics acceleration ](https://ra1ahq.blog/en/vklyuchenie-v-mozilla-firefox-podderzhki-api-egl) 

 [ ![No picture](https://ra1ahq.blog/user/themes/mytheme/images/no-image.png) Internet browsers for Linux ](https://ra1ahq.blog/en/internet-browsers-linux) 

 [ ![](https://ra1ahq.blog/images/0/5/c/6/c/05c6c7f6e2b69227f1bcbdb5116d33b8b103e3b2-ff-new.png) Installing or updating Mozilla FireFox web browser from third-party APT repository "apt.fruit.je" ](https://ra1ahq.blog/en/ustanovka-ili-obnovlenie-veb-brauzera-mozilla-firefox-iz-storonnego-apt-repozitoriya-apt-fruit-je) 

[ Backward](https://ra1ahq.blog/en/montirovanie-iso-obrazov-cd-dvd-diskov-v-linux "Previuous page")

[ Forward ](https://ra1ahq.blog/en/belaya-noch-v-pitere-21-22-iyunya-2022 "Next page")

## Languages

- [Русский](https://ra1ahq.blog/posts/uskorenie-mozilla-firefox-pri-pomoshi-ram-diska)
- [English](https://ra1ahq.blog/en/uskorenie-mozilla-firefox-pri-pomoshi-ram-diska)
- [Deutsch](https://ra1ahq.blog/de/posts/uskorenie-mozilla-firefox-pri-pomoshi-ram-diska)
- [Français](https://ra1ahq.blog/fr/posts/uskorenie-mozilla-firefox-pri-pomoshi-ram-diska)
- [中文 (简体) (cn)](https://ra1ahq.blog/zh-cn/posts/uskorenie-mozilla-firefox-pri-pomoshi-ram-diska)

## Theme

## RSS feeds

 [ Atom 1.0](https://ra1ahq.blog/en/.atom) [ RSS](https://ra1ahq.blog/en/.rss) 

## Popular tags

 [APRS](https://ra1ahq.blog/en/tag:APRS) [CW](https://ra1ahq.blog/en/tag:CW) [DX](https://ra1ahq.blog/en/tag:DX) [FM](https://ra1ahq.blog/en/tag:FM) [Linux](https://ra1ahq.blog/en/tag:Linux) [VHF](https://ra1ahq.blog/en/tag:VHF) [antennas](https://ra1ahq.blog/en/tag:antennas) [firefox](https://ra1ahq.blog/en/tag:firefox) [morse](https://ra1ahq.blog/en/tag:morse) [soundtrack](https://ra1ahq.blog/en/tag:soundtrack) [video](https://ra1ahq.blog/en/tag:video) [windows](https://ra1ahq.blog/en/tag:windows) [youtube](https://ra1ahq.blog/en/tag:youtube) [КВ](https://ra1ahq.blog/en/tag:%D0%9A%D0%92) [ТВ](https://ra1ahq.blog/en/tag:%D0%A2%D0%92) [УКВ](https://ra1ahq.blog/en/tag:%D0%A3%D0%9A%D0%92) [антенны](https://ra1ahq.blog/en/tag:%D0%B0%D0%BD%D1%82%D0%B5%D0%BD%D0%BD%D1%8B) [безопасность](https://ra1ahq.blog/en/tag:%D0%B1%D0%B5%D0%B7%D0%BE%D0%BF%D0%B0%D1%81%D0%BD%D0%BE%D1%81%D1%82%D1%8C) [длинные волны](https://ra1ahq.blog/en/tag:%D0%B4%D0%BB%D0%B8%D0%BD%D0%BD%D1%8B%D0%B5%20%D0%B2%D0%BE%D0%BB%D0%BD%D1%8B) [путешествия](https://ra1ahq.blog/en/tag:%D0%BF%D1%83%D1%82%D0%B5%D1%88%D0%B5%D1%81%D1%82%D0%B2%D0%B8%D1%8F) [религия](https://ra1ahq.blog/en/tag:%D1%80%D0%B5%D0%BB%D0%B8%D0%B3%D0%B8%D1%8F) [соревнования](https://ra1ahq.blog/en/tag:%D1%81%D0%BE%D1%80%D0%B5%D0%B2%D0%BD%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D1%8F) [спутники](https://ra1ahq.blog/en/tag:%D1%81%D0%BF%D1%83%D1%82%D0%BD%D0%B8%D0%BA%D0%B8) [средние волны](https://ra1ahq.blog/en/tag:%D1%81%D1%80%D0%B5%D0%B4%D0%BD%D0%B8%D0%B5%20%D0%B2%D0%BE%D0%BB%D0%BD%D1%8B) [схемы](https://ra1ahq.blog/en/tag:%D1%81%D1%85%D0%B5%D0%BC%D1%8B) [тесты](https://ra1ahq.blog/en/tag:%D1%82%D0%B5%D1%81%D1%82%D1%8B) [трансивер](https://ra1ahq.blog/en/tag:%D1%82%D1%80%D0%B0%D0%BD%D1%81%D0%B8%D0%B2%D0%B5%D1%80) [управление](https://ra1ahq.blog/en/tag:%D1%83%D0%BF%D1%80%D0%B0%D0%B2%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5) [фотографии](https://ra1ahq.blog/en/tag:%D1%84%D0%BE%D1%82%D0%BE%D0%B3%D1%80%D0%B0%D1%84%D0%B8%D0%B8) 

## Random post

 [ I'll be lucky!](https://ra1ahq.blog/en/random) 

## Archive of posts

- [ October 2026 ✒ 4 ](https://ra1ahq.blog/en/archives_month:oct_2026)
- [ September 2026 ✒ 9 ](https://ra1ahq.blog/en/archives_month:sep_2026)
- [ August 2026 ✒ 6 ](https://ra1ahq.blog/en/archives_month:aug_2026)
- [ July 2026 ✒ 13 ](https://ra1ahq.blog/en/archives_month:jul_2026)
- [ June 2026 ✒ 8 ](https://ra1ahq.blog/en/archives_month:jun_2026)
- [ May 2026 ✒ 2 ](https://ra1ahq.blog/en/archives_month:may_2026)
- [ April 2026 ✒ 6 ](https://ra1ahq.blog/en/archives_month:apr_2026)
- [ March 2026 ✒ 3 ](https://ra1ahq.blog/en/archives_month:mar_2026)
- [ February 2026 ✒ 7 ](https://ra1ahq.blog/en/archives_month:feb_2026)
- [ January 2026 ✒ 8 ](https://ra1ahq.blog/en/archives_month:jan_2026)
- [ December 2025 ✒ 12 ](https://ra1ahq.blog/en/archives_month:dec_2025)
- [ November 2025 ✒ 9 ](https://ra1ahq.blog/en/archives_month:nov_2025)
- [ October 2025 ✒ 8 ](https://ra1ahq.blog/en/archives_month:oct_2025)
- [ September 2025 ✒ 5 ](https://ra1ahq.blog/en/archives_month:sep_2025)
- [ August 2025 ✒ 8 ](https://ra1ahq.blog/en/archives_month:aug_2025)
- [ July 2025 ✒ 6 ](https://ra1ahq.blog/en/archives_month:jul_2025)
- [ June 2025 ✒ 10 ](https://ra1ahq.blog/en/archives_month:jun_2025)
- [ May 2025 ✒ 4 ](https://ra1ahq.blog/en/archives_month:may_2025)
- [ April 2025 ✒ 4 ](https://ra1ahq.blog/en/archives_month:apr_2025)
- [ March 2025 ✒ 4 ](https://ra1ahq.blog/en/archives_month:mar_2025)
- [ February 2025 ✒ 11 ](https://ra1ahq.blog/en/archives_month:feb_2025)
- [ December 2024 ✒ 8 ](https://ra1ahq.blog/en/archives_month:dec_2024)
- [ November 2024 ✒ 2 ](https://ra1ahq.blog/en/archives_month:nov_2024)
- [ October 2024 ✒ 8 ](https://ra1ahq.blog/en/archives_month:oct_2024)
- [ September 2024 ✒ 3 ](https://ra1ahq.blog/en/archives_month:sep_2024)
- [ August 2024 ✒ 5 ](https://ra1ahq.blog/en/archives_month:aug_2024)
- [ July 2024 ✒ 9 ](https://ra1ahq.blog/en/archives_month:jul_2024)
- [ June 2024 ✒ 6 ](https://ra1ahq.blog/en/archives_month:jun_2024)
- [ May 2024 ✒ 7 ](https://ra1ahq.blog/en/archives_month:may_2024)
- [ April 2024 ✒ 5 ](https://ra1ahq.blog/en/archives_month:apr_2024)
- [ March 2024 ✒ 5 ](https://ra1ahq.blog/en/archives_month:mar_2024)
- [ February 2024 ✒ 5 ](https://ra1ahq.blog/en/archives_month:feb_2024)
- [ January 2024 ✒ 6 ](https://ra1ahq.blog/en/archives_month:jan_2024)
- [ December 2023 ✒ 7 ](https://ra1ahq.blog/en/archives_month:dec_2023)
- [ November 2023 ✒ 4 ](https://ra1ahq.blog/en/archives_month:nov_2023)
- [ October 2023 ✒ 8 ](https://ra1ahq.blog/en/archives_month:oct_2023)
- [ September 2023 ✒ 7 ](https://ra1ahq.blog/en/archives_month:sep_2023)
- [ August 2023 ✒ 4 ](https://ra1ahq.blog/en/archives_month:aug_2023)
- [ July 2023 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jul_2023)
- [ June 2023 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jun_2023)
- [ May 2023 ✒ 5 ](https://ra1ahq.blog/en/archives_month:may_2023)
- [ April 2023 ✒ 6 ](https://ra1ahq.blog/en/archives_month:apr_2023)
- [ March 2023 ✒ 5 ](https://ra1ahq.blog/en/archives_month:mar_2023)
- [ February 2023 ✒ 2 ](https://ra1ahq.blog/en/archives_month:feb_2023)
- [ January 2023 ✒ 5 ](https://ra1ahq.blog/en/archives_month:jan_2023)
- [ December 2022 ✒ 7 ](https://ra1ahq.blog/en/archives_month:dec_2022)
- [ November 2022 ✒ 8 ](https://ra1ahq.blog/en/archives_month:nov_2022)
- [ October 2022 ✒ 6 ](https://ra1ahq.blog/en/archives_month:oct_2022)
- [ September 2022 ✒ 9 ](https://ra1ahq.blog/en/archives_month:sep_2022)
- [ August 2022 ✒ 8 ](https://ra1ahq.blog/en/archives_month:aug_2022)
- [ July 2022 ✒ 4 ](https://ra1ahq.blog/en/archives_month:jul_2022)
- [ June 2022 ✒ 9 ](https://ra1ahq.blog/en/archives_month:jun_2022)
- [ May 2022 ✒ 7 ](https://ra1ahq.blog/en/archives_month:may_2022)
- [ April 2022 ✒ 3 ](https://ra1ahq.blog/en/archives_month:apr_2022)
- [ March 2022 ✒ 4 ](https://ra1ahq.blog/en/archives_month:mar_2022)
- [ February 2022 ✒ 6 ](https://ra1ahq.blog/en/archives_month:feb_2022)
- [ January 2022 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jan_2022)
- [ December 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:dec_2021)
- [ November 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:nov_2021)
- [ October 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:oct_2021)
- [ September 2021 ✒ 10 ](https://ra1ahq.blog/en/archives_month:sep_2021)
- [ August 2021 ✒ 6 ](https://ra1ahq.blog/en/archives_month:aug_2021)
- [ July 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jul_2021)
- [ June 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:jun_2021)
- [ May 2021 ✒ 7 ](https://ra1ahq.blog/en/archives_month:may_2021)
- [ April 2021 ✒ 4 ](https://ra1ahq.blog/en/archives_month:apr_2021)
- [ March 2021 ✒ 4 ](https://ra1ahq.blog/en/archives_month:mar_2021)
- [ February 2021 ✒ 3 ](https://ra1ahq.blog/en/archives_month:feb_2021)
- [ January 2021 ✒ 4 ](https://ra1ahq.blog/en/archives_month:jan_2021)
- [ December 2020 ✒ 8 ](https://ra1ahq.blog/en/archives_month:dec_2020)
- [ November 2020 ✒ 2 ](https://ra1ahq.blog/en/archives_month:nov_2020)
- [ October 2020 ✒ 3 ](https://ra1ahq.blog/en/archives_month:oct_2020)
- [ September 2020 ✒ 3 ](https://ra1ahq.blog/en/archives_month:sep_2020)
- [ August 2020 ✒ 5 ](https://ra1ahq.blog/en/archives_month:aug_2020)
- [ July 2020 ✒ 5 ](https://ra1ahq.blog/en/archives_month:jul_2020)
- [ June 2020 ✒ 8 ](https://ra1ahq.blog/en/archives_month:jun_2020)
- [ May 2020 ✒ 10 ](https://ra1ahq.blog/en/archives_month:may_2020)
- [ April 2020 ✒ 4 ](https://ra1ahq.blog/en/archives_month:apr_2020)
- [ March 2020 ✒ 2 ](https://ra1ahq.blog/en/archives_month:mar_2020)
- [ January 2020 ✒ 1 ](https://ra1ahq.blog/en/archives_month:jan_2020)
- [ December 2019 ✒ 2 ](https://ra1ahq.blog/en/archives_month:dec_2019)

## Search

## Weather forecast

[На 14 дней](https://world-weather.ru/pogoda/russia/saint_petersburg/14days/)
[world-weather.ru](https://world-weather.ru/)

---

## Navigation

- Parent: [RA1AHQ](https://ra1ahq.blog/en/index.md)
- Previous: [White Night in St. Petersburg June 21-22 2022](https://ra1ahq.blog/en/belaya-noch-v-pitere-21-22-iyunya-2022.md)
- Next: [Mounting CD/DVD ISO images in Linux](https://ra1ahq.blog/en/montirovanie-iso-obrazov-cd-dvd-diskov-v-linux.md)
