LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   System backup using <dd> (https://www.linuxquestions.org/questions/linux-desktop-74/system-backup-using-dd-4175544538/)

seabag 06-04-2015 08:34 PM

System backup using <dd>
 
I have a 60GB HDD in Acer 2300, Ubuntu 12.04(non-PAE) beta. It is partitioned as sda1-58GB, and sda2-2GB, subbed into sda5 2GB swap file.

I want to use dd to backup sda1 to an external USB 1TB expansion storage drive, identified by DiskUtility as /dev/sdb

I created a folder on the expansion drive to receive the dump: DiskDump04Ju15

I write: <sudo dd if=/dev/sda of=/dev/sdb/DiskDump04Jun15>
The return is: dd: opening `/dev/sdb/DiskDump04Jun15': Not a directory

How do I use dd to create the image in another drive?

Thank you so much,
seabag

syg00 06-04-2015 09:47 PM

First you say you want to backup sda1, but you're attempting to back up the entire drive - including swap. Can be done, but it pays to know exactly what you want to do with backups.
Next I suspect the external drive is partitioned, so the "of" should probably be referencing /dev/sdb1. Let's see the output from this
Code:

lsblk -o +LABEL -l

seabag 06-04-2015 10:00 PM

The output is: 2300:~$ lsblk -o +LABEL -l
lsblk: unknown column: +LABEL

You are right about the sda ambiguity. I want to backup /dev/sda. Backin up sda1 would probably suffice since sda2 only contains a swap file.

I have not partitioned the external drive. I have been using it to save files only.
Am I in a mess?

syg00 06-04-2015 10:25 PM

No mess - yet :p

I don't use Ubuntu, so try it as "lsblk -l"

descendant_command 06-05-2015 12:46 AM

If you want to store the image on an existing filesystem on the external drive you will need to mount it somewhere (like /mnt/external/ or such) and invoke dd something like
Code:

dd if=/dev/sda1 of=/mnt/external/DiskDump04Jun15/sda1.dd.img

seabag 06-05-2015 08:58 AM

@ syg00 - output 2300:~$ lsblk -l
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 55.9G 0 disk
sda1 8:1 0 53.9G 0 part /
sda2 8:2 0 1K 0 part
sda5 8:5 0 2G 0 part [SWAP]
sr0 11:0 1 1024M 0 rom
sdb 8:16 0 1.8T 0 disk
sdb1 8:17 0 1.8T 0 part /media/Seagate Expansion Drive

seabag 06-05-2015 10:00 AM

@ descendant_command:
-2300:~$ sudo dd if=/dev/sda1 of=/media/sdb1/DiskDump04Ju15/sda1.dd.img
dd: opening `/media/sdb1/DiskDump04Ju15/sda1.dd.img': No such file or directory

2300:~$ sudo dd if=/dev/sda1 of=/dev/sdb1/DiskDump04Ju15/sda1.dd.img
dd: opening `/dev/sdb1/DiskDump04Ju15/sda1.dd.img': Not a directory

I think we are very close. I try to make a directory on the expansion drive:
joseph@joseph-TravelMate-2300:~$ cd /media
joseph@joseph-TravelMate-2300:/media$ ls
Seagate Expansion Drive
joseph@joseph-TravelMate-2300:/media$ cd Seagate Expansion Drive
bash: cd: Seagate: No such file or directory

seabag 06-05-2015 10:04 AM

I am getting confused about what is the difference between a folder, e.g. create a new folder, and a Directory, e.g. mkdir.

Is a folder a directory? Is it two names for the same thing?

fatmac 06-05-2015 10:19 AM

Quote:

Originally Posted by seabag (Post 5372582)
I am getting confused about what is the difference between a folder, e.g. create a new folder, and a Directory, e.g. mkdir.

Is a folder a directory? Is it two names for the same thing?

Basically, yes.
Unix uses directories, as did MSDOS, then MSWindows started calling them folders, so now 2 names for the same thing. :)

fatmac 06-05-2015 10:27 AM

Question: Why do you want to back up with dd, would it not be easier to use tar (or maybe rsync); do you want copies of your files or your disk?
I suspect tar (& gzip) is what you really want to use. ;)

fatmac 06-05-2015 10:38 AM

Quote:

I write: <sudo dd if=/dev/sda of=/dev/sdb/DiskDump04Jun15>
The return is: dd: opening `/dev/sdb/DiskDump04Jun15': Not a directory
Mount /dev/sdb1 on /mnt, using a live system, as I'm sure you can't use dd on a mounted system, then
Code:

dd if=/dev/sda1 of=/mnt/DiskDump04Jun15 bs=1M

seabag 06-05-2015 10:39 AM

joseph@joseph-TravelMate-2300:/media$ sudo dd if=/dev/sda1 of=/sdb1/
dd: opening `/sdb1/': Is a directory

joseph@joseph-TravelMate-2300:/media$ cd /sdb1
bash: cd: /sdb1: No such file or directory

joseph@joseph-TravelMate-2300:/media$ cd /sdb1/
bash: cd: /sdb1/: No such file or directory

seabag 06-05-2015 10:56 AM

@ Fatmac Thanks for the references! Also you have tweaked an idea: perhaps I should be doing all this from a live CD; that way I will not be mounted on sda1? What I am trying to accomplish is an image file of my computer, or at least sda1. This computer is ten years old, a broken XP, that was donated to me after a devastating house robbery. I wiped the disk and installed Unbuntu and I have no backup other than personal files like music and documents that I have moved into folders on the backup drive (2T, USB.)

It has taken a long time to set up 12.04-nonPAE. (I have gone through various ver. of Ubuntu) I have resolved several HW issues and I want to save this work in the event of a disk failure.

I will put in a live CD and go through this routine again! :-)

seabag 06-05-2015 12:35 PM

Things seem to be going from bad to worse. I have lost the ability to mount the external USB HDD. I tried and some syntax variations:

joseph@joseph-TravelMate-2300:/etc$ sudo mount -t ntfs /dev/sdb1 /media
ntfs-3g: Failed to access volume '/dev/sdb1': No such file or directory

ntfs-3g 2012.1.15AR.1 external FUSE 28 - Third Generation NTFS Driver
Configuration type 7, XATTRS are on, POSIX ACLS are on

Copyright (C) 2005-2007 Yura Pakhuchiy
Copyright (C) 2006-2009 Szabolcs Szakacsits
Copyright (C) 2007-2011 Jean-Pierre Andre
Copyright (C) 2009 Erik Larsson

Usage: ntfs-3g [-o option[,...]] <device|image_file> <mount_point>

Options: ro (read-only mount), remove_hiberfile, uid=, gid=,
umask=, fmask=, dmask=, streams_interface=.
Please see the details in the manual (type: man ntfs-3g).

Example: ntfs-3g /dev/sda1 /mnt/windows

News, support and information: http://tuxera.com

It did not mount; but what has happened is that lsblk now shows that the external drive is seen as sdc, no longer sdb! I feel like the shit is getting deeper.

I just want to make an image file of sda1 onto an external drive. I did this a long time ago with Windows7 onto this same external drive. It was a three button event. There must be some way to do it in Linux.

seabag 06-05-2015 12:38 PM

Yesterday I could mount the external HDD from GUI file manager. Today I cannot.


All times are GMT -5. The time now is 07:03 PM.