Skip to main content

Create large 1G Ramdisk on Red Hat Enterprise 4 Linux

Might as well put this up because I had a bit of a time finding info on this. The question is, how do you make a large ramdisk on linux (specifically for me, Red Hat Enterprise 4). Took a combination of other people's posts to put it together.

The basics are:
1. Edit /etc/grub.conf to add ramdisk_size = xxx (in kb) at the end of the 'kernal' line. I wanted to get a 1G ramdisk, so: ramdisk_size = 1000000

2. Reboot.

3. Double check things are ok: dmesg | grep RAMDISK

4. Then format the disk. I want the whole 1G in one disk. And here's the little tidbit. Apparantly, the default behavior for mke2fs is to create block sizes of 1024 for ramdisk sizes <= 512M. For larger sizes, it creates block sizes of 4096. If you use the default, you'll get the error something like this:
"wrong fs type, bad option, bad superblock on /dev/sda1, or too many mounted file systems"
when you try to mount your ramdisk.

So you need to do this:
mke2fs -b 1024 -m 0 /dev/ram0
(-m is optional; use if you don't want space reserved for root user)

5. Now you can mount the ramdisk: mount /dev/ram0 /var/mountpoint

6. Check to see if all is well with: df

And there you have it. A big ramdisk.

Comments

Popular posts from this blog

Add a user with root privileges on a linux system running busybox

The problem with busybox is that it doesn't support a whole bunch of useful stuff that would help in this situation, such as sudo, and therefore the wheel solution proposed in other posts, in /etc/sudoers , can't be done. Likewise, usermod is not available, and even adduser -u 0 doesn't work because it complains that "UID 0 is already used". What you have to do is simple: adduser user vi /etc/passwd and modify the uid of user . /etc/passwd will look something like this: root:x:0:0:root:/home:/bin/sh daemon:x:1:1:daemon:/usr/sbin:/bin/sh sampleUser:x:1000:1000:Linux User,,,:/home/sampleUser:/bin/sh to give sampleUser root privileges, edit like this: sampleUser:x:0:0:Linux User,,,:/home/sampleUser:/bin/sh I.e. set sampleUser's uid = 0 Done.

Dad's Nobel week official spport in Stockholm

I wanted to add that we had two amazing people to help us during Nobel Week. Dad had two people to help him during the week: Lena, for driving him around, and Eva, to help organize everything. We found out some interesting professional info about Dad's driver for the Nobel Week, Lena, when we had the opportunity to socialize a bit with her and Eva when we had dinner with Minister Lee, on the evening before the Big Day. The restaurant the Minister's people had picked was, of course, a chinese restaurant. It wasn't too far, but more on the outskirts of the city. We drove in the limo, with the others in taxis that had been arranged to pick everyone up from the Nordic Museum after the reception there (all thanks to Lena's organization). Because it was outside of town, mum felt like we shouldn't make Lena and Eva hang around and wait for us, so she invited them. Minister Lee was quite happy to have them included, and in fact, his driver sat at our table too, sitting next...

Mercey Hot Springs camping

Just returned from a nice weekend trip that included camping at Mercey Hot Springs, off I5 on Little Panoche Rd. Originally, the trip was going to be a camping trip to Pinnacles National Monument, with a side trip to Mercey Hot Springs, but on the way down, we thought we'd call them and see if they had any camping sites. They did, so we booked. And so we headed directly there, down 101 to 152E to I5 to the Little Panoche Rd exit. The scenery is central valley barren on the way there, but Mercey Hot Springs is a little oasis. It's far from luxury, but if it's the rustic, relaxed feeling you're after, this is a great place. The main pool and soaking tubs look quite recently done. There's a sauna building with two shower/facilities rooms, 5 campsites, 6 cabins, a clothing optional hot tub area, and parking for RVs. We were in one of the camping spots, #5 to be precise. It's the end one and a nice, more private location. When we arrived to set up camp, around 5pm, t...