This guide is aimed at people with 7200 RPM HDDs, and to highlight the importance of solid state drives. If used poorly, well, I’m sure you know how that story ends.I'd like to present a pretty helpful guide today. If used wisely, a ramdisk can be a serious benefit to your data center servers. The last thing you want is to depend upon it, only to lose precious data, thanks to a black out. Make sure to use this type of non-persistent storage wisely. Now, should you lose power or have to reboot the machine, you won’t lose data. The above crontab entry will backup your ramdisk data every fifteen minutes. Issue the command sudo crontab -e and then add the following: Give the backup script executable permissions with the command chmod u+x ramdisk_backup.sh. Save and close that file (we’ll name it /root/ramdisk_backup.sh). Where /BACKUP/PATH is a path to a location to house the backup of /media/ramdisk. You could create a very simple bash script with the following contents: Backup that ramdisk dataīecause we’re dealing with non-persistent memory, you’re going to want to set up a regular backup. If you receive no warnings, you’re good to go. You can test the newly modified /etc/fstab file with the command mount -a. None /media/ramdisk tmpfs nodev,nosuid,noexec,nodiratime,size=2048M 0 0 ![]() Open up that file and add the following (edit to suit your needs): What if you want to have the ramdisk automatically created at boot? This can be done with the help of /etc/fstab. Sudo umount /media/ramdisk Automounting the ramdisk When you’re done using the ramdisk, you can unmount it with the command: That mounted directory can now be used at your discretion. ![]() In the above example, I have mounted 2GB of RAM to be used as a temporary file system to /media/ramdisk. You can adjust both the size and the mount point to fit your needs. Sudo mount -t tmpfs -o size=2048M tmpfs /media/ramdisk This is accomplished with the following command: Now we actually mount the newly created directory to a temporary storage area (one that will use RAM as opposed to hard drive space). Oracle Linux checklist: What to do after installation This Linux learning path will help you start using the OS like a proītop is a much-improved take on the Linux top command ![]() Open-source repository SourceHut to remove all cryptocurrency-related projects I like /media because it is the same location other drives will be mounted into by default. You can name that folder whatever you like and place it anywhere on the directory structure. To do that, open up a terminal window and issue the command: The first thing you must do is create a folder that will be used to mount the ramdisk. I’ll be working with Ubuntu 16.04, but this will work on nearly any distribution. Because of that, it is important to do a regular backup of the directory used for your ramdisk (more on that in a bit). Should you lose power (or shut down the machine), whatever you’re working on could be lost. Ramdisks, of course, come with a serious caveat. This method of storage is considerably faster than standard hard disk storage, so it is a great tool for when you need blistering speed on a specific app. Effectively, a ramdisk takes a portion of your system memory and uses it as a disk drive. In some cases, the best route to that is by making use of a ramdisk. There may be instances where you need to include the fastest possible storage you can find on a server. ![]() Here's how to create one, mount it, and back it up. If you need to boost the speed of data writes to storage on your Linux data center servers, a ramdisk might be what you need.
0 Comments
Leave a Reply. |