You can work with your hard drives, network drives and other external or USB storage devices accomplishing critical linux hacks. Yes, technology nowadays have enabled us to make use of larger and more stable storage capacity drives and devices. Most firms and company services enjoy the benefits of having them as part of their IT infrastructure. What's good of having them are your data is still there between system reboots.
Here's a quick entry on how to create Read Access Memory (RAM) disk from Fedora.
What is RAM Disk
A RAM disk is a portion of Read Access Memory (RAM) which is temporarily used as if it were a disk drive. RAM disks have fixed sizes, and can be mounted like regular disk partitions. RAM disks can be a great place to store temporary data for temporary task.
Additionally, one advantage of having RAM disk is that access time with RAM disk is much faster than for physical disk. However, RAM disk is volatile type of disk. Any data stored on a RAM disk will be lost after shutting down the system or powering off. Another issue of having RAM disk is that RAM memory allocated as RAM disk would no longer be available for application's usage from system's overall memory capacity.
Creating RAM Disk
By default, kernel 2.4.x and kernel 2.6.x supports RAM disk. Fedora by default supports 16 RAM disks from ram0 to ram15 as shown below and assigns them with default 16MB RAM of disk size when mounted.
# ls -la /dev/ram*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lrwxrwxrwx 1 root root 4 2008-01-21 07:56 /dev/ram -> ram1
brw-r----- 1 root disk 1, 0 2008-01-21 12:02 /dev/ram0
brw-r----- 1 root disk 1, 1 2008-01-21 07:56 /dev/ram1
brw-r----- 1 root disk 1, 10 2008-01-21 07:56 /dev/ram10
brw-r----- 1 root disk 1, 11 2008-01-21 07:56 /dev/ram11
brw-r----- 1 root disk 1, 12 2008-01-21 07:56 /dev/ram12
brw-r----- 1 root disk 1, 13 2008-01-21 07:56 /dev/ram13
brw-r----- 1 root disk 1, 14 2008-01-21 07:56 /dev/ram14
brw-r----- 1 root disk 1, 15 2008-01-21 07:56 /dev/ram15
brw-r----- 1 root disk 1, 2 2008-01-21 07:56 /dev/ram2
brw-r----- 1 root disk 1, 3 2008-01-21 07:56 /dev/ram3
brw-r----- 1 root disk 1, 4 2008-01-21 07:56 /dev/ram4
brw-r----- 1 root disk 1, 5 2008-01-21 07:56 /dev/ram5
brw-r----- 1 root disk 1, 6 2008-01-21 07:56 /dev/ram6
brw-r----- 1 root disk 1, 7 2008-01-21 07:56 /dev/ram7
brw-r----- 1 root disk 1, 8 2008-01-21 07:56 /dev/ram8
brw-r----- 1 root disk 1, 9 2008-01-21 07:56 /dev/ram9
lrwxrwxrwx 1 root root 4 2008-01-21 07:56 /dev/ramdisk -> ram0
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can check if your current linux kernel supports RAM by issuing
# dmesg |grep RAM
You should be seeing similar lines like this
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
BIOS-provided physical RAM map:
RAMDISK driver initialized: 16 RAM disks of 16384K size 4096 blocksize
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Format RAM Disk for Initialization
Now, let us start using a single RAM disk and format it.
# mkfs.ext3 /dev/ram0
Alternatively, RAM disk creation without a journalized file system would be
# mke2fs -m 0 /dev/ram0
Mounting RAM Disk
Create a temporary mounting point
# mkdir /mnt/ram
Mount RAM disk
# mount /dev/ram0 /mnt/ram
Operate on RAM disk such as copying file
# cd /mnt/ram
# cp /bin/ls .
Congratulations! You have just created a single 16MB RAM disk which is only available from your current CPU session. This RAM disk would vanish when you shutdown or reboot your system.
If you wish to take a look more of your RAM disk details, simply
# tune2fs -l /dev/ram0
Change Default RAM Size
If you wish to overwrite linux default RAM disk size, you can pass RAM size parameter to linux kernel during reboot. This can be accomplished by editing your /etc/grub.conf and append the below line to the kernel parameter
ramdisk_size=4000
Well, a linux tip to make your RAM disk allocation permanent is to include it on one of your startup script or to /etc/rc.local. This approach would mount RAM disk permanently between reboots though the old data would not be there.
Hope you find this interesting, enjoy.
Related Article:
Mounting and Burning ISO Images, Burning DVD/CD Images
HowTo: Add New HardDisk to Linux
Optimize Your HardDisk Read Performance
HowTo: NTFS Drive to Linux
TestDisk - Linux Partitioning Tool
Subscription
Categories
- HowTos (612)
- Linux Devices (40)
- Linux Diggs (620)
- Linux News (1541)
- Linux Videos (24)
Recent Posts
Blog Archive
-
▼
2008
(2301)
-
▼
January
(49)
- HowTo: Brasero
- HowTo: ISOs Management for Fedora
- HowTo: Install Nmap with GUI FrontEnd
- HowTo: Create and Manage Genealogy Family Tree via...
- HowTo: Install KFTPGrabber FTP Client
- HowTo: Install FileZilla 3 on Fedora 8
- HowTo: Be Alerted via Popups When Monitoring Log F...
- HowTo: Mount Windows Drive From Linux GUI
- HowTo: Delete Files With 0K Filesize Recursively
- HowTo: Changing Interface's MTU Size
- HowTo: Create Vanishing Virtual Drive
- HowTo: Install Identity.pub Into Remote Machines
- HowTo: Check and Mark Bad Block Of Hard Disk
- HowTo: Install Linux Hardware Browser
- HowTo: Basic RPM Package Queries And Usage
- HowTo: Rebuild Locked Out RPM Database
- HowTo: Display RPM Packages Installed Last Month
- HowTo: Display and List Out All Package Files Rece...
- HowTo: Identify Source Package Name Of A File or F...
- HowTo: Delete Extra Spaces Between Words From Files
- HowTo: Find Hidden Directory Folders Recursively
- HowTo: Create Hidden Directory Folder
- HowTo: Print Only Lines of Text File with N charac...
- HowTo: Sort Files by FileSize and What Else?
- HowTo: Squeezed Out Multiple Lines From Text File
- HowTo: Prevent Binary Execution From Mounted Device
- HowTo: Determine Domain's Expiration Date From Lin...
- HowTo: Create and Overwrite Existing Alias
- HowTo: Get MAC Address of PCs Around
- HowTo: List Out Hidden Files and Hidden Directory ...
- HowTo: Identify Valid Login Shells
- HowTo: Deny User from Logging Into Your System
- HowTo: Remove Tabs From Text Files Completely
- HowTo: Convert Tabs In Each File To Spaces
- HowTo: Install and Say Cheese
- HowTo: Install HomeBank and Manage Personal & ...
- HowTo: Install Mind-Mapping LabyRinth Tool
- HowTo: Install VMWare Server on Fedora 8
- HowTo: Install VMWare Workstation on Fedora 8
- HowTo: Virtual PCLinux 2007 via VirtualBox over Fe...
- HowTo: Enable PortMap on Fedora 8
- HowTo: Linux Hardware Lister Tool - LsHw
- HowTo: Install Bandwidth Shaper - Trickle on Fedora
- HowTo: VnStat Long-Term Traffic Monitoring via CLI
- HowTo: Install NetSpeed Traffic Monitoring Applet
- HowTo: Install IPTraff LAN Monitoring Tool
- HowTo: Install Ibmonitor Interface Bandwidth Monitor
- HowTo: Install IfTop Bandwidth Monitoring Tool
- HowTo: Fedora WordPress Installation
-
▼
January
(49)
Monday, January 21, 2008
HowTo: Create Vanishing Virtual Drive
Subscribe to:
Post Comments (Atom)
ILoveTux - howtos and news | About | Contact | TOS | Policy
0 comments:
Post a Comment