Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Scan drives and re-create a partition table based on "guesses"
- sudo gpart /dev/sdc
- #Use the following commands to interrogate the drive:
- dmesg
- sudo fdisk OR sudo fdisk -l
- sudo blkid
- lsblk
- mount
- lsusb
- usb-devices
- df -h
- #Track logs to see mount errors. If all ok, proceed to mount (next step)
- tail -f /var/log/{kernel,dmesg,syslog}
- #Mount a windows share to copy the backups to. Mount this drive (/media/ubuntu/casper-rw/jkmount) onto the target folder (in this case a folder on the network). This would be slow though. Faster is to use a USB disk
- sudo mount -t cifs //192.168.0.103/backups/laptop /media/ubuntu/casper-rw/jkmount -o username=admin,noexec
- #List drives
- sudo fdisk -l
- #Run disk mirror script
- sudo dd if=/dev/sda of=/media/ubuntu/casper-rw/jkmount/disk1.img bs=4M
- #Alternatively run ddrescue. GNU ddrescue is not a derivative of dd, nor is related to dd in any way except in that both can be used for copying data from one device to another. The key difference is that ddrescue uses a sophisticated algorithm to copy data from failing drives causing them as little additional damage as possible. It dumps all readable sectors to a file. If it hangs up on a huge chunk of bad sectors, you can run ddrescue backwards, reading the end of the disk toward the beginning. Then run SpinRite on the drive to see if it can recover any of the failed sectors. Run ddrescue again, which will only attempt the failed sectors from the first run. Finally, run the actual recovery software on the resulting image file.
- #Provide a log file so that you can resume ddrescue from the point it stopped. the r parameter is the number of retry passes the tool needs to do over bad sectors.
- sudo ddrescue -d -r3 /dev/sda media/ubuntu/casper-rw/jkmount/disk1.img /home/user/recovery.log
- #Recover directly to another disk
- ddrescue -d -f -r3 /dev/sda /dev/sdb /media/PNY_usb/rescue.logfile
- #parse the log file using:
- ddrescuelog -t recovery.log
- #See the "rescued" entry to see how much data was recovered.
- #Unmount
- sudo umount ~/mnt
- #Restore using dd or ddrescue
- sudo dd if=/mnt/nas_tv/backup.img of=/dev/sda status=progress
- www.howtogeek.com/howto/19446/make-a-drivea-image-using-an-ubuntu-live-cd/?PageSpeed=noscript
Advertisement
Add Comment
Please, Sign In to add comment