- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Create DAT file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-28-2009 08:43 AM
тАО12-28-2009 08:43 AM
Howto compress files to *.dat file?
For example, I can decompress files from a ramdisk.dat using 7-Zip, but howto compress back to *.dat after changes?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-28-2009 04:10 PM
тАО12-28-2009 04:10 PM
SolutionSince you placed this question into Linux section of this forum, I assume this might be something Linux-related. In this case, the name "ramdisk.dat" suggests this might be a Linux boot-time initrd or initramfs (INITial Ram Disk/ RAM File System), or something else.
Initrd and initramfs are similar in purpose, but very different in structure. Initrd is a GZIP compressed disk image that contains a filesystem of some type: the type must match what's available in the kernel that is going to use it.
Depending on the type of the filesystem, you might be able to uncompress the file with gunzip and then mount it as a disk image in Linux: that would allow making changes to the disk image, sort of like if it was an USB stick or other removable media.
Some special-purpose (high-compression) filesystems won't allow write access: these filesystems must be "built" using a special tool, similar to creating .ISO images with the mkisofs/genisoimage command.
So if it's an initrd-style file, it will be necessary to identify the filesystem type, or find some documentation that lists the correct type.
Initramfs, on the other hand, is simply a GZIP compressed "cpio" archive. One reason for its design was to avoid the complexity of initrd.
The Linux kernel documentation includes the procedures for extracting initramfs files and creating new ones:
http://www.mjmwired.net/kernel/Documentation/filesystems/ramfs-rootfs-initramfs.txt
Googling for "ramdisk.dat" finds various targets, like Acronis TrueImage or Ultimate Boot CD. If your question is related to customizing one of these for your environment, please say so: we can neither read your mind nor take a peek into your system to find out what you're doing.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-29-2009 01:28 AM
тАО12-29-2009 01:28 AM
Re: Create DAT file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 11:29 AM
тАО12-30-2009 11:29 AM
Re: Create DAT file
ramdisk.dat: gzip compressed data, was "ramdisk.dat.initrd", from FAT filesystem (MS-DOS, OS/2, NT), last modified: Mon Nov 10 02:00:20 2008
# file -i ramdisk.dat
ramdisk.dat: application/x-gzip
I've tried first to uncompress under linux using gzip, but it doesn't work:
# gzip -d ramdisk.dat
gzip: ramdisk.dat: unknown suffix -- ignored
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 02:28 PM
тАО12-30-2009 02:28 PM
Re: Create DAT file
> gzip: ramdisk.dat: unknown suffix -- ignored
man gzip
You could rename the file, or you could feed
it in from stdin.
gzip -dc < ramdisk.dat > ramdisk2.dat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 05:31 PM
тАО12-30-2009 05:31 PM
Re: Create DAT file
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-30-2009 10:23 PM
тАО12-30-2009 10:23 PM
Re: Create DAT file
> ramdisk2.dat or mount it?
How did you make the thing? How should we
know more about what's in it than you do?
"mount -o loop [...]"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2009 04:43 AM
тАО12-31-2009 04:43 AM
Re: Create DAT file
# gzip -dc < ramdisk.dat > ramdisk2.dat
and I'd like to get (mount) all files from ramdisk2.dat.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2009 06:07 AM
тАО12-31-2009 06:07 AM
Re: Create DAT file
If it says just "data", that means the "file" command cannot identify it. If it says something like "cpio archive", it's most likely an initramfs: it cannot be mounted, but you can use the "cpio" command to extract (and later re-package) it: see my previous answer for a link to instructions.
If your Linux distribution has "fstyp" or "fsstat" available, you can try these commands too:
fstyp ramdisk2.dat
fsstat -t ramdisk2.dat
If the ramdisk2.dat is a filesystem image, either of these commands might be able to identify the filesystem type used in the image. That would help a lot in selecting the proper tools for modifying/rebuilding the file.
If it is a filesystem image, it can be mounted like this if the filesystem type is supported by your current Linux kernel:
mkdir -p /mnt/ramdisk
mount -o loop,rw ramdisk2.dat /mnt/ramdisk
If the filesystem won't support read-write access (cramfs, squashfs or similar), the mount command may fail. You may have to mount it read-only instead:
mount -o loop,ro ramdisk2.dat /mnt/ramdisk
If the mount command is successful, then you can view /proc/mounts to identify the filesystem type.
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2009 02:29 PM
тАО12-31-2009 02:29 PM
Re: Create DAT file
# fstyp ramdisk2.dat
#
# fstat ramdisk2.dat
USER CMD PID FD MOUNT INUM MODE SZ|DV R/W NAME
# mkdir -p /mnt/ramdisk
# mount -o loop,rw ramdisk2.dat /mnt/ramdisk
mount: you must specify the filesystem type
# mount -o loop,ro ramdisk2.dat /mnt/ramdisk
mount: you must specify the filesystem type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-31-2009 02:35 PM
тАО12-31-2009 02:35 PM
Re: Create DAT file
# 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-02-2010 03:56 PM
тАО01-02-2010 03:56 PM
Re: Create DAT file
# 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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-02-2010 04:23 PM
тАО01-02-2010 04:23 PM
Re: Create DAT file
> 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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-02-2010 04:35 PM
тАО01-02-2010 04:35 PM
Re: Create DAT file
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-04-2010 10:59 PM
тАО01-04-2010 10:59 PM
Re: Create DAT file
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2010 08:16 AM
тАО01-05-2010 08:16 AM
Re: Create DAT file
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-05-2010 01:21 PM
тАО01-05-2010 01:21 PM
Re: Create DAT file
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.