cancel
Showing results for 
Search instead for 
Did you mean: 

Re: Create DAT file

 
SOLVED
Go to solution
Super Advisor

Re: Create DAT file

using tar seems to work well:

# tar xvzf ramdisk.dat -C /mnt/ramdisk

# ls -l /mnt/ramdisk
total 24
drwxr-xr-x 2 root <<<<<<< current 1024 Aug 15 2007 bin
drwxr-xr-x 2 root <<<<<<< current 512 Aug 15 2007 dev
drwxr-xr-x 7 root <<<<<<< current 512 Aug 15 2007 etc
-rwxr-xr-x 1 root <<<<<<< current 272 Aug 14 2007 init
drwxr-xr-x 3 root <<<<<<< current 2048 Aug 15 2007 lib
drwxr-xr-x 2 root <<<<<<< current 512 Aug 15 2007 mnt
drwxr-xr-x 2 root <<<<<<< current 512 Aug 15 2007 proc
drwxr-xr-x 2 root <<<<<<< current 512 Aug 15 2007 sbin
drwxr-xr-x 2 root <<<<<<< current 512 Aug 15 2007 sys
drwxrwxr-x 2 root <<<<<<< current 512 Aug 15 2007 tmp
drwxr-xr-x 3 root <<<<<<< current 512 Aug 15 2007 usr
drwxr-xr-x 2 root <<<<<<< current 512 Aug 15 2007 var


Super Advisor

Re: Create DAT file

It's quite interesting that tar with this file works only under freeBSD, it doesn't work under linux:

# tar xvzf ramdisk.dat -C /mnt/ramdisk
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors
Honored Contributor

Re: Create DAT file

> It's quite interesting that tar with this
> file works only under freeBSD, it doesn't
> work under linux:

It _might_ be interesting if we knew which
"tar" programs were involved.

tar --version

(And if we knew that you were working with
the same data in both cases.)

> # tar xvzf ramdisk.dat -C /mnt/ramdisk

Probably not where I'd put something other
than a mount point for a file system, but
it's your system.
Super Advisor

Re: Create DAT file

There is exact the same file and mount points on both systems are OK.

freeBSD:
# tar --version
bsdtar 2.2.5 - libarchive 2.2.4

Debian Lenny:
# tar --version
tar (GNU tar) 1.20
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.
Honored Contributor

Re: Create DAT file

That's because it's a CPIO image..

initrd / ramdisk images are gzip'd CPIO files.

To extract 'ramdisk.dat':

tmp]# mkdir image; cd image
image]# gzip -cd ../ramdisk.dat | cpio -vidum

To re-create the ramdisk image:

image]# find . -print | cpio -ocv | gzip -9 > ../ramdisk-new.dat
One long-haired git at your service...
Super Advisor

Re: Create DAT file

I've done what u suggested:

linux:/tmp# mkdir image; cd image
linux:/tmp/image# gzip -cd /home/ramdisk/ramdisk.dat | cpio -vidum

and the linux server doesn't start anymore.
Honored Contributor

Re: Create DAT file

> and the linux server doesn't start anymore.

I don't recall having been shown the contents
of this cpio archive ("cpio -tv"), so I know
nothing, but if it contained absolute paths
instead of relative paths, then restoring it
(with "-u") might have overwritten a
directory like, say, "/dev", with
inappropriate data, and that could make a
system unusable.