SliTaz SliTaz Forum

You are not logged in.

#1 2013-04-03 00:06:53

andy9100
Member
Registered: 2013-03-08
Posts: 6

make ramdisk failed

Hello I want make a ramdisk filesystem on slitaz,

every thing is ok, but at last step, I want to gzip the ramdisk, I found the file in the ramdisk is empty after gzip.

the following is my step:

dd if=/dev/zero of=rootfs.img bz=1024 count=131072

mkfs.ext3 -F -m 0 -b 1024 rootfs.img 131072

mkdir img

mount -oloop rootfs.img img

//here copy my rootfs files to img

//and after copy, i check the img size is about 100M

sync

umount img

//above everything is ok

gzip rootfs.img  // this step, will zip my rootfs.img to very small size, about 300K

so I unzip the rootfs.img.gz, and mount again, found there's nothing, the rootfs files I copied here is disappear.

and the same step I can make the ramdisk successfully on ubuntu or centos.

thanks

Offline

#2 2013-04-03 01:24:10

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: make ramdisk failed

Not sure why you do that

I seem to remember that there is a tmpfs (ram) file in Slitaz... ??

Offline

#3 2013-04-03 06:55:52

andy9100
Member
Registered: 2013-03-08
Posts: 6

Re: make ramdisk failed

it seems that gzip works wrong, but I don't know the reason.

I appreciate your help.

thanks.

Offline

#4 2013-04-03 22:36:27

christophe
Member
Registered: 2011-04-17
Posts: 432

Re: make ramdisk failed

not sure i helped

I checked what you did

You mount the file as loopback filesystem, not ram filesystem.

I do not think it is the gzip command which failed, i think it might be the mount command OR you believe you have copied the file in the img fs, while you have NOT, hence you should check what really has worked or not.

try this:

mkdir /img

mount -o loop,rw rootfs.img /img

once you have copied the files to /img do

cd /img

check that your files are there

then

umount /img

mount -o loop,rw rootfs.img /img.

ls -l /img

and check that your files are still there

if that worked so far then proceed with gzip

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.015 seconds, 7 queries executed - Memory usage: 1.53 MiB (Peak: 1.77 MiB) ]