LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 06-04-2015, 08:34 PM   #1
seabag
Member
 
Registered: Oct 2014
Location: Loja, Ecuador
Distribution: 12.04-nonPAE(beta)
Posts: 93

Rep: Reputation: Disabled
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

Last edited by seabag; 06-04-2015 at 08:36 PM.
 
Old 06-04-2015, 09:47 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,133

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
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
 
Old 06-04-2015, 10:00 PM   #3
seabag
Member
 
Registered: Oct 2014
Location: Loja, Ecuador
Distribution: 12.04-nonPAE(beta)
Posts: 93

Original Poster
Rep: Reputation: Disabled
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?

Last edited by seabag; 06-04-2015 at 10:02 PM.
 
Old 06-04-2015, 10:25 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,133

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
No mess - yet

I don't use Ubuntu, so try it as "lsblk -l"
 
1 members found this post helpful.
Old 06-05-2015, 12:46 AM   #5
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
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
 
Old 06-05-2015, 08:58 AM   #6
seabag
Member
 
Registered: Oct 2014
Location: Loja, Ecuador
Distribution: 12.04-nonPAE(beta)
Posts: 93

Original Poster
Rep: Reputation: Disabled
@ 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
 
Old 06-05-2015, 10:00 AM   #7
seabag
Member
 
Registered: Oct 2014
Location: Loja, Ecuador
Distribution: 12.04-nonPAE(beta)
Posts: 93

Original Poster
Rep: Reputation: Disabled
@ 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
 
Old 06-05-2015, 10:04 AM   #8
seabag
Member
 
Registered: Oct 2014
Location: Loja, Ecuador
Distribution: 12.04-nonPAE(beta)
Posts: 93

Original Poster
Rep: Reputation: Disabled
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?
 
Old 06-05-2015, 10:19 AM   #9
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,501

Rep: Reputation: Disabled
Quote:
Originally Posted by seabag View Post
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.
 
1 members found this post helpful.
Old 06-05-2015, 10:27 AM   #10
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,501

Rep: Reputation: Disabled
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.

Last edited by fatmac; 06-05-2015 at 10:31 AM.
 
Old 06-05-2015, 10:38 AM   #11
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,501

Rep: Reputation: Disabled
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
 
1 members found this post helpful.
Old 06-05-2015, 10:39 AM   #12
seabag
Member
 
Registered: Oct 2014
Location: Loja, Ecuador
Distribution: 12.04-nonPAE(beta)
Posts: 93

Original Poster
Rep: Reputation: Disabled
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
 
Old 06-05-2015, 10:56 AM   #13
seabag
Member
 
Registered: Oct 2014
Location: Loja, Ecuador
Distribution: 12.04-nonPAE(beta)
Posts: 93

Original Poster
Rep: Reputation: Disabled
@ 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! :-)
 
Old 06-05-2015, 12:35 PM   #14
seabag
Member
 
Registered: Oct 2014
Location: Loja, Ecuador
Distribution: 12.04-nonPAE(beta)
Posts: 93

Original Poster
Rep: Reputation: Disabled
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.
 
Old 06-05-2015, 12:38 PM   #15
seabag
Member
 
Registered: Oct 2014
Location: Loja, Ecuador
Distribution: 12.04-nonPAE(beta)
Posts: 93

Original Poster
Rep: Reputation: Disabled
Yesterday I could mount the external HDD from GUI file manager. Today I cannot.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to perform system backup with backup-manager on Linux LXer Syndicated Linux News 0 11-14-2014 08:40 AM
Tar fails on system backup - need to backup remote web server cilbuper Linux - General 2 08-26-2014 12:28 AM
how to take system backup like system restore in windows piyush.ml20 Linux - Newbie 3 09-26-2008 03:57 PM
Backup system ala rdiff-backup, but without mirror and with dst encryption dr_dex Linux - Software 0 08-04-2008 03:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 11:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration