User Tools

Site Tools


ubuntu:disk:ramdisk:persisting_ramdisk_data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
ubuntu:disk:ramdisk:persisting_ramdisk_data [2021/06/22 11:01] – created peterubuntu:disk:ramdisk:persisting_ramdisk_data [2021/06/22 11:18] (current) – [Test] peter
Line 1: Line 1:
 ====== Ubuntu - Disk - Ramdisk - Persisting Ramdisk Data ====== ====== Ubuntu - Disk - Ramdisk - Persisting Ramdisk Data ======
  
-A Ramdisk will usually lose all data within it when turned off, or upon reboot.+A Ramdisk is temporary storage device.
  
-The approach is:+When the computer is shutdown all the data within the Ramdisk is erased. 
 + 
 +To ensure this data is retained, the approach taken here is:
  
   * Save Ramdisk data to hard drive on system shutdown.   * Save Ramdisk data to hard drive on system shutdown.
Line 9: Line 11:
  
 <WRAP info> <WRAP info>
-**NOTE:**  The directory where the Ramdisk is mounted and where the backup data will be saved must have the same file permissions.+**NOTE:**  The syncing from the Ramdisk to the hard disk and vice-versa will be slow, but at least the data will be stored permanently. 
 + 
 +  * In essence, the Ramdisk acts here as a cache. 
 </WRAP> </WRAP>
  
Line 49: Line 54:
 WantedBy=multi-user.target WantedBy=multi-user.target
 </file> </file>
 +
 +<WRAP info>
 +**NOTE:**  The directory where the Ramdisk is mounted and where the backup data will be saved must have the same file permissions.
 +</WRAP>
 +
 +
 +----
 +
 +===== Enable the ramdisk-sync service =====
 +
 +<code bash>
 +sudo systemctl enable ramdisk-sync.service
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  The ramdisk-sync service will start automatically on system boot.
 +</WRAP>
 +
 +----
 +
 +===== Reboot =====
 +
 +<code bash>
 +sudo reboot
 +</code>
 +
 +----
 +
 +===== Check whether the ramdisk-sync service is running =====
 +
 +<code bash>
 +sudo systemctl status ramdisk-sync
 +</code>
 +
 +----
 +
 +===== Check the contents of the /mnt/ramdisk and /mnt/ramdisk_backup directories =====
 +
 +<code bash>
 +ls /mnt/ramdisk{,_backup}
 +</code>
 +
 +<WRAP info>
 +**NOTE:**  Both should be empty.
 +</WRAP>
 +
 +----
 +
 +===== Test =====
 +
 +Copy some files to the Ramdisk /mnt/ramdisk.
 +
 +Reboot again.
 +
 +Check again the contents of both the /mnt/ramdisk and /mnt/ramdisk_backup directories.
 +
 +  * They should be the same!
 +
 +----
 +
  
  
ubuntu/disk/ramdisk/persisting_ramdisk_data.1624359661.txt.gz · Last modified: 2021/06/22 11:01 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki