Disk Archiving Linux Commands

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
__   _
  -o)/ /  (_)__  __ ____  __                   Derek Winterstien
  /\\ /__/ / _ \/ // /\ \/ /                   r.o.a.c.h.@.r.o.b.o.t.z...c.o.m
 _\_v __/_/_//_/\_,_/ /_/\_\

Creation Date: Thu Sep  2 13:49:25 CDT 2004                   current ver 0.21
------------------------------------------------------------------------------
originally: floppy-cdrom-archiving.txt
ARCHIVE DATA AND floppy disks to hard drive and cdrom - notes collection
NEW: Simple way to Burn CD's under Linux and Cygwin.  Also,  Ghost for Unix, 
archive an entire hard drive to image "like norton ghost" (clone hard drive 
containing MS Windows, Linux, or most any Operating System)
SEE ALSO: Our disc ripping and burning guide, cdripandburn.txt
------------------------------------------------------------------------------

[ Section I: ] Archive Floppy Disks to Image Files

Floppy disks go bad, eventually.  Linux provides a free utility to create 
a complete image of your floppy disks.  The image represents the entire disk,
including boot sector.

  (a) create an image file from a 1.44MB HD floppy disk.

  command: dd if=/dev/fd0 of=imagename.img count=1 bs=1440k 

  (b) restore from image to clean 1.44MB HD floppy disk.

  command: dd if=imagename.img of=/dev/fd0 count=1 bs=1440k 


[ Section II: ] ISO Image Creation and Mounting Without Using an Actual CDROM 

ISO Images are generally used to burn onto a blank cdrom. But did you know 
that you can actually 'mount' and ISO image file as if it were a data CD?

  (a) mount an ISO image file

  command: mount -t iso9660 -o loop imagename.iso /mnt/isoimage  
  
  (b) create an ISO image file from a cdrom disc with dd (be sure the cdrom is
  NOT MOUNTED.  If it is mounted, then umount the device.)

  command: dd if=/dev/cdrom of=cdimage.iso       <- for ide cdrom
           dd if=/dev/scd0 of=cdimage.iso        <- scsi cdrom
           dd if=/dev/dvd of=dvdimage.iso        <- ide dvd

  (c) create an ISO image file with mkisofs

  command: mkisofs -f -R -r -l -J -V yourvolumeid -o /destination /source
 
  other options are: -A application description
                     -P publisher information

  You can use mkisofs to make an iso cd image from a directory of files on
  your harddrive.  Here is a basic example where I copied the files into 
  a directory named 'burnme' under /tmp.

  command:  mkisofs -o /tmp/cdimage.iso /tmp/burnme/

  (d) write ISO image to cdrom with ISO 9660 fs std using cdrecord

  command: cdrecord -v -pad speed=1 dev=0,0,0 imagefilename.iso  

  (e) additional information

  dev=0,0,0 is the first IDE cdrom device.  This will not work with a SCSI
            cdrom drive or a second IDE drive without adjusting the parameter.

  speed=x being the write speed. I recommend 8.

[ Section III: ] Creation of an Audio CDROM Disc

  (a) create audio cdrom using cdrecord

  command: cdrecord -v -pad speed=1 dev=0,0,0 -dao -audio -swab *.wav

  (b) additional information

  *.wav refers to all of the wav audio files you have already prepared in a
        directory.  Each in order becoming the tracks on the cdrom disc.


[ Section IV: ] Hard drive cloning of any operating system with Ghost for Unix

  g4u ( http://www.feyrer.de/g4u/ ) ("ghost for unix") is a NetBSD-based
  bootfloppy/CD-ROM that allows easy cloning of PC harddisks to deploy a common
  setup on a number of PCs using FTP. 

  @@@ Create Floppy and Ghost System @@@

  (a) create the g4u floppy:

  command: cat g4u-1.17.fs >/dev/fd0

  (b) on the ftp server create account 'install'

  (c) boot from the floppy the system you want to ghost

  (d) make sure lan supports dhcp, floppy boots up ok type:

  command: uploaddisk ftp.server.com driveimagename.gz wd0

  (e) the wd0 part is optional, it specifies the first ide disk,  You may
      specifiy the second hardrive with wd1 or third with... so on ...
      for a scsi drive use sd0, or sd1 ... so on ...

  @@@ Verify the image is good. @@@

  command: gzip -vt image.gz

  @@@ Restore System or Clone From Image @@@

  (a) boot from the floppy the system you want to restore

  (b) connect to the ftp server and retrieve the image

  command: slurpdisk ftp.server.com driveimagename.gz wd0

  (c) again the wd0 is optional

  You may also choose to use a bootable cdrom if your system does not have a
  floppy drive.  Personally, I think it is a waste of a big cd for just a few
  little files.

  Simply use the iso file to create a bootable cdrom.

  You may wish to copy one hard drive to another in the same machine without
  regard to network or server.  For this use the 'copydisk' command.  The
  bootable floppy or cdrom is NetBSD (simular to Linux).  Copy an IDE or SCSI
  drive with the following command

  command: copydisk wd0 wd1

  command: copydisk sd0 sd1

  When using g4u note that you may restore a ghost image to a drive the same
  size or larger than the original drive.  Recommend you ghost a smaller drive
  if you intend to create a re-deployable image install the OS on the smallest
  drive in your lan so it will fit on all the other identical systems.

  


Updated

See Disk Imaging for Linux


some related pages