Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
tryed sudo ddrescue /dev/sda /home/custom/user/sda_image.img /home/custom/user/logfile problem is would not mount under /mnt to see if it worked so tryed sudo ddrescue /dev/sda /home/custom/user/sda_image.iso /home/custom/user/logfile the sda_image.img file is 55gb ...
  1. #1
    Linux Newbie
    Join Date
    Jan 2010
    Location
    usa
    Posts
    124

    use ubuntu to clone a windows hard drive with ntfs

    tryed
    sudo ddrescue /dev/sda /home/custom/user/sda_image.img /home/custom/user/logfile

    problem is would not mount under /mnt to see if it worked

    so tryed
    sudo ddrescue /dev/sda /home/custom/user/sda_image.iso /home/custom/user/logfile

    the sda_image.img file is 55gb the other one tht is .iso is 0gb

    so now trying

    dd if=/dev/sda of=/home/custom/usr/sda_image.iso

    waiting to see what is going on any body got any advice on how to make the image work?

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,977
    Please say exactly what you are trying to accomplish and I'll try to give you a step-by-step. I do disc imaging of NTFS volumes and Windows system discs (as well as Linux partitions and drives) all the time without problems. Saved my (and my clients') bacon on more than one occasion.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    I'm sure Rub will walk you through it when you give details, but one thing that's wrong with what you're doing and what you're saying is that if you expect to be able to mount the image, it needs to be of a partition, e.g. /dev/sda1, not the full disk device.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,977
    Quote Originally Posted by greyhairweenie View Post
    I'm sure Rub will walk you through it when you give details, but one thing that's wrong with what you're doing and what you're saying is that if you expect to be able to mount the image, it needs to be of a partition, e.g. /dev/sda1, not the full disk device.
    Actually GHW, you can mount a file system that is inside a full disc image. It's just a bit harder. You have to figure the offset of the first block of the partition, and pass that information to the mount command. I've done it, but you are right in that for people who aren't into major brain burn, mounting an image of a partition is tonnes easier!
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Not the first time I've learned something from your posts. Wasn't aware of that option to a loop mount.

  6. #6
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,977
    Here is the part of the mount man page that covers that.

    Code:
    THE LOOP DEVICE
           One further possible type is a mount via the loop device. For example, the command
    
             mount /tmp/fdimage /mnt -t vfat -o loop=/dev/loop3
    
           will set up the loop device /dev/loop3 to correspond to the file /tmp/fdimage, and then mount  this  device  on
           /mnt.
    
           This  type  of  mount  knows about four options, namely loop, offset, sizelimit and encryption, that are really
           options to losetup(8).  (These options can be used in addition to those specific to the filesystem type.)
    
           If no explicit loop device is mentioned (but just an option ‘-o loop’ is given), then mount will  try  to  find
           some unused loop device and use that.
    
           Since  Linux  2.6.25  is supported auto-destruction of loop devices and then any loop device allocated by mount
           will be freed by umount independently on /etc/mtab.
    
           You can also free a loop device by hand, using ‘losetup -d’ or ‘umount -d‘.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #7
    Linux Enthusiast Mudgen's Avatar
    Join Date
    Feb 2007
    Location
    Virginia
    Posts
    623
    Yep, that's the first place I went after seeing your previous response. The actual offset option is documented in the losetup manpage, but it's not immediately clear how to set the option on the mount command line to get it passed to losetup. It's "-o offset" for losetup, but -o is the option switch itself for mount. How do you put the offset into the mount command?

  8. #8
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,977
    Code:
    mount [-t type] filename mount-point -o loop[=/dev/loopN],offset=NNNNNNN
    That's how I did it. Keeping the calculator app handy is good to compute the offset in bytes from the start sector of the partition...
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #9
    Just Joined!
    Join Date
    Dec 2008
    Location
    San Jose, CA
    Posts
    4
    Quote Originally Posted by lancebermudez View Post
    tryed
    sudo ddrescue /dev/sda /home/custom/user/sda_image.img /home/custom/user/logfile

    problem is would not mount under /mnt to see if it worked

    so tryed
    sudo ddrescue /dev/sda /home/custom/user/sda_image.iso /home/custom/user/logfile

    the sda_image.img file is 55gb the other one tht is .iso is 0gb

    so now trying

    dd if=/dev/sda of=/home/custom/usr/sda_image.iso

    waiting to see what is going on any body got any advice on how to make the image work?
    Why not use Clonezilla? It is a one trick pony, but it does cloning easily. You download it and burn it to CD. It makes a boot disk.

  10. #10
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    the offset isn't even technically necessary, one time to fool a dell DRAC device I created a disk image file, create fs on it, and then mounted it on the DRAC and it looked just like a regular usb stick, then i mounted it back on my local machine and everything i copied was there, i just use the -o loop and nothing else

    the best part though, was that i just did all this on a hunch and it ended up working

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...