1

I'm trying to crete a ramdisk of 2gb in centOS 6.2 and the error I get is the following. Any help would be greatly appreciated.

[root@ssb1 ~]# mkfs -q /dev/ram0 2147483648
 mkfs.ext2: Filesystem larger than apparent device size.
 Proceed anyway? (y,n)

grub.conf

title CentOS (2.6.36.4)
    root (hd0,0)
    kernel /vmlinuz-2.6.36.4 ro root=UUID=be58af32-27ac-45fe-8341-715df43497ac rd_NO_LUKS rd_NO_LVM rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYBOARDTYPE=pc KEYTABLE=us crashkernel=auto rhgb quiet raid=noautodetect elevator=noop ramdisk_size=2147483648

Memory info

[root@ssb1 ~]# free
             total       used       free     shared    buffers     cached
Mem:      49455672    3185524   46270148          0      18228     164792
-/+ buffers/cache:    3002504   46453168
Swap:            0          0          0
egorgry
  • 2,871
  • 2
  • 23
  • 21
  • How much RAM do you have in your machine, and how large is the RAMdisk going to be? – Frederik Jul 10 '12 at 12:54
  • 1
    Why not use the built-in support for dynamic ramdisks? – Ignacio Vazquez-Abrams Jul 10 '12 at 13:09
  • I'm not totally familiar with the built in ramdisk but I'll look into it. Thanks. I'm building this for an appliance and the OS lives on a CF card I want to minimize writes to the card by logging system and our own logs and tmp files to ram. – egorgry Jul 10 '12 at 14:05
  • Wow, old skool. `tmpfs` has totally eaten the old ramdisk model for lunch. – womble Jul 10 '12 at 17:07
  • I'm trying to keep it real. :) Haven't had a moment today it look at tmpfs. I see it's already mounted on centOS /dev/shm. – egorgry Jul 10 '12 at 18:33

2 Answers2

1

See https://superuser.com/questions/255060/how-can-i-change-the-amount-and-size-of-linux-ramdisks-dev-ram0-dev-ram15

In particular,

mount -t tmpfs -o size=10g none /mnt/point
pjc50
  • 1,720
  • 10
  • 12
0

Is this a 32 bit OS or a 64 bit OS?

It looks like you are using 3GB of RAM already and creating a 2GB RAM disk would put you over that magic 4GB mark that 32 bit systems can't handle.

Ladadadada
  • 26,337
  • 7
  • 59
  • 90