1751967 Members
4606 Online
108783 Solutions
New Discussion юеВ

Re: ramdisk

 
all star
Occasional Advisor

ramdisk

Hi,

I would like to create a ramdisk which would be more than 500MB size. i'm using system installed with FC 4. how to increase ram disk size?

so did the following to create the ramdisk file.

i modified /etc/grub.conf file
kernel /boot/vmlinuz-2.6.11-1.1369_FC4smp ro root=LABEL=/ rhgb quiet ram
disk_size=600000

once the system boots, i use the following commands
[root@chakri-linux ~]# mke2fs /dev/ram0, this command is successful,

but when i try to mount i get the following error message

[root@chakri-linux ~]# mount /dev/ram0 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/ram0,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


any clue what needs to be done?

regards
Chakri






6 REPLIES 6
Ivan Ferreira
Honored Contributor

Re: ramdisk

Maybe is not detecting the file system type, please try with:

mkfs -t ext2 /dev/ram0 /mnt
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Vitaly Karasik_1
Honored Contributor

Re: ramdisk

dmesg | grep RAMDISK

output?
Geert Van Pamel
Regular Advisor

Re: ramdisk

The following should work for any Red Hat variant:

vi /etc/fstab
none /ramdisk tmpfs size=500m 0 0

mkdir /ramdisk

mount /ramdisk

df -k

Filesystem 1K-blocks Used Available Use% Mounted on
none 512000 0 512000 0% /ramdisk

all star
Occasional Advisor

Re: ramdisk

i was able to create a ramdik file image sucessfully, but now when i try to boot the system with the created ramdisk image, it gives the following error message, what should i look for??

kernel panic: VFS unable to mount root fs on unknown-block

Geert Van Pamel
Regular Advisor

Re: ramdisk

Well... if you first create your RAM disk, and then you reboot your system, the system does not find the RAM disk for obvious reasons... you should make the RAM disk permanent in one way or another...

You might also create the RAM disk from a shell script:

mount -t tmpfs -o size=500m none /ramdisk

But then you need to restore the file system from a backup copy because after each poweroff or restart the disk in RAM is gone...

If you perform an umount /ramdisk all the data is lost also; so you definitely need to backup the disk at regular times, and you should use an UPS to protect your system from powerfailures...
Justin_99
Valued Contributor

Re: ramdisk

Times when I have seen that panic on boot after creating a new initrd image was due to not having the correct disk driver in /etc/sysconfig/kernel when I made the new initrd image. So when the system booted it couldn't mount /dev/sda1 to / because it couldn't access /dev/sda1 because there was no driver. Had to boot via rescue disk and make new image.