You are not logged in.

#1 2011-10-29 03:06:23

hungsonbk
Member
Registered: 2007-05-26
Posts: 105
Website

Can't create Ramdisk larger tham 16M

Hi Archers,

I am trying to create a ramdisk but can't create ramdisk higher than 16MB. If I create a ramdisk smaller tham 16MB, everything is ok, but if I create higher, I got the following error:

mkfs -t ext4 /dev/ramcache 102400

mke2fs 1.41.14 (22-Dec-2010)
mkfs.ext4: Filesystem larger than apparent device size.
Proceed anyway? (y,n) y
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
25688 inodes, 102400 blocks
5120 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=67371008
13 block groups
8192 blocks per group, 8192 fragments per group
1976 inodes per group
Superblock backups stored on blocks:
    8193, 24577, 40961, 57345, 73729

mkfs.ext4: Invalid argument while zeroing block 102336 at end of filesystem
Writing inode tables: done                           
Creating journal (4096 blocks): mkfs.ext4: Invalid argument
    while trying to create journal



I have even re-compiled the kernel with followings but get the same problem
CONFIG_BLK_DEV_RAM=m
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=524288

Any Solution for this?

Cheers

Offline

#2 2011-10-29 08:37:01

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Can't create Ramdisk larger tham 16M

I've never made a ramdisk that way, I always make an entry in fstab with the size:

tmpfs		/tmp		tmpfs	noatime,nodev,size=1g,mode=1777	0 0

Note the size=1g option

Offline

#3 2011-10-29 08:41:04

hungsonbk
Member
Registered: 2007-05-26
Posts: 105
Website

Re: Can't create Ramdisk larger tham 16M

fukawi2 wrote:

I've never made a ramdisk that way, I always make an entry in fstab with the size:

tmpfs		/tmp		tmpfs	noatime,nodev,size=1g,mode=1777	0 0

Note the size=1g option


I would like to create a Ramdis such as /dev/ram0 so that I can mount and unmount it without losing my data. with tmpfs, after unmount, all my data will be erased.

Cheers

Offline

#4 2011-10-29 13:48:31

djgera
Developer
From: Buenos Aires - Argentina
Registered: 2008-12-24
Posts: 723
Website

Re: Can't create Ramdisk larger tham 16M

I do not know what is your objetive, but at least there is a better thing to use as block device on ram that is managed via sysfs and is compressed: zram.

# modprobe zram
# echo $((512*2**20)) > /sys/block/zram0/disksize
# mkfs.ext4 /dev/zram0
# cat /sys/block/zram0/orig_data_size 
217088
# cat /sys/block/zram0/compr_data_size 
2859

Read the documentation for better details.

Offline

Board footer

Powered by FluxBB