• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • Last Modified:

Linux Ubuntu partition syntax confusion

So I have gddrescue installed and I am trying to figure out what signifies the entire contents of the harddrive. Now the syntax:

 ddrescue /dev/<partition_to_backup>  filename.iso

First, what does /dev signify?  If it means root, what specifies everything in it?  I am a Linux newb obviously.

I want to make sure that whatever back up I create, is able to be put on a new ubuntu install and all applications etc can be used and configured identical to how this install is.  

Thanks.
0
jkockler
Asked:
jkockler
  • 7
  • 6
  • 5
  • +1
5 Solutions
 
Maciej SsysadminCommented:
In /dev/ directory you have devices. So ie. /dev/hda means - get device hda, which is primary master drive. /dev/hda1 - primary master drive, 1st partition.
0
 
jkocklerAuthor Commented:
well that makes sense but it can not find the input file /dev/hda or dev/hda1  .... How do I see what my primary hd partition is called?
0
 
Maciej SsysadminCommented:
Run "mount" command. You will see then what partitions you have mounted. If you don't know what the output means, paste it here.
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
AdamsConsultingCommented:
I think just doing a df will show you an easier to parse display of the partitions you need to backup.

From the shell, try typing this:

df

Just backup the ones that start with /dev
0
 
fosiul01Commented:
hi yah

have a look to this one

http://www.cyberciti.biz/tips/how-do-i-save-recover-data-from-crashed-disks-with-dd-and-ddrescue-command.html#comments

and how to use ddrescue with explanation

http://www.linux.com/feature/152592

you can youse fdisk -l command to check the hardrive and partition information on your pc
0
 
jkocklerAuthor Commented:
Here is the output of the mount command.  It looks like its called sda1.  What does that stand for?

/dev/sda1 on / type ext3 (rw,relatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
/proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
lrm on /lib/modules/2.6.27-11-generic/volatile type tmpfs (rw,mode=755)
securityfs on /sys/kernel/security type securityfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)

0
 
fosiul01Commented:
Hi
sda is the First hardrive

and  sda1 its the first partition of first harddrive.

what does fdisk -l show ??
0
 
Maciej SsysadminCommented:
/dev/sda can be sata/scsi/usb drive. I'm guessing, that you have sata drive.
So, if you want to backup (create image of) your whole drive, you should run:
ddrescue /dev/sda filename.iso

As you have just one partition (/dev/sda1) you may use:
ddrescue /dev/sda1 filename.iso
which will create image of all your data on your partition (excluding master boot record - in your situation I would rather run ddrescue with /dev/sda instead of /dev/sda1).
0
 
Maciej SsysadminCommented:
Oh, and I think it would be good to have filename.iso on some separate drive (you can attach ie. some external usb drive). Ie you can attach external usb drive, mount it as - ie /mnt/my_usb_drive, and then run:
ddrescue /dev/sda /mnt/my_usb_drive/filename.iso

Just in case, because I'm not sure how ddrescue will behave when it will have destination file on the same drive as source.
0
 
jkocklerAuthor Commented:
Ok, so what command will actually create the master boot record?  the ddrescue /dev/sda filename.iso ?

Will that command include data in mounted network volumes?  I would prefer not, obviously

And if I do not create the filename.iso on an external source, will it end up puting the filename.iso into the backup that it is creating?

I would like to be able to take the data in the iso image, put onto another hard drive, then put that hard drive into another computer and have it load identical to this computer.  
0
 
fosiul01Commented:
HI yah
for better understanding the  second link i provided if you would read that that would be good

if you look at that one about ddrecue command

ddrescue -v /dev/sda /dev/sdb


so here : /dev/sda is the old one

and /dev/sdb is the new one where you want to keep the backup of old one

if you run this one

ddrescue /dev/<partition_to_backup>  filename.iso

i have a doubt it would not run. because you didnot specify where you want to backup

so as OKlit said
you should mount either usb or in another hardrive
0
 
Maciej SsysadminCommented:
1. ddrescue /dev/sda filename.iso will include everything (mbr also).
2. No, network volumes will not be included (as you are creating image of sda device)
3. I really don't know. If you give me some time, I'll try to simulate this on my virtual machine.
4. You can achieve this even without creating iso file. Just plug your second harddrive to your computer, I assume, that it will be usb drive, and it will be recognized as /dev/sdb. Then, you can run: ddrescue /dev/sda /dev/sdb, and you will get exact copy of /dev/sda on /dev/sdb (on your usb device).
0
 
jkocklerAuthor Commented:
Thanks!  That helps a lot!
0
 
jkocklerAuthor Commented:
Ok, it seems to be writing blank space??   have barely any data on this drive and the ISO file exceeded 200 GB..  It had to stop writing because it ran of space on the local drive.  I specified to create the iso on the desktop but I will try it on an external now.
0
 
fosiul01Commented:
when you wil try to copy to external hardrive..

suppose if you want to copy 10Gb data to a new hardrive, make sure you have more then 10 GB space in the newhardrive, other wise it might fail
0
 
Maciej SsysadminCommented:
Yes. ddrescue copies drive as it is. It doesn't care if there are any data on the disk - it copies empty space also. (it just creates _exact_ copy of your current drive).
0
 
jkocklerAuthor Commented:
1.  so if it copies exact copy of current drive, then that would mean a brand new, unformatted sata drive, connected to the computer via usb in an external enclosure, would be fully functional after running the ddrescue to it?  And any unaccounted space would not be usable on the new drive, unless I expanded the partition as referenced in  http://www.linux.com/feature/152592 .....  is that right?

2.)  This is great for imaging a new drive but rather cumbersome route if I just want to backup my directories in case of a crash .. Is there a way to make a copy of all the directories to an external drive, without having to manually copy each directory with the CP command?  I would just copy paste but it is ubuntu and wants sudo for the copy and nautilus command does not allow me to move files over the network.  My usb drive is connected through the network, not attached directly to the linux box.  Thanks



0
 
fosiul01Commented:
about the 1: yes, if you dont want to expand then it should be allright

about 2:
you can take full backup of your hardrive such as /var/, /etc/ ,/root directory automatically  to any linux pc by usinng RSYNC

you just need to write a backup script and attach that one with cron job, so all data from this pc will be copied over to another pc
or another location as you want.

0
 
Maciej SsysadminCommented:
1. Yes - you should be able to connect your new drive to another computer, and have it working out of the box (unless your current computer has some specific setup. If it is almost default installation + additional software, it should be ok).
About free space - on your new disk, you can make your partition larger (as you wrote), or you can just create new partition and mount it somewhere.

2. To simply backup your files, you can use a lot of utilities - cp, tar, rsync, and much more.
You can use tar ie, to create full data backup: "tar cf /your_backup.tar /" - this command should create an /your_backup.tar archive, which will contain all your data (without master boot records - files/directories only).
So, to restore this after ie. your harddrive is damaged, you have to install linux on your new drive, and then restore your backup to that new installation.
You can also use rsync + snapshots (rsnapshot) to easy achieve backups. Take a look on rsnapshot: http://www.rsnapshot.org/faq.html
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

  • 7
  • 6
  • 5
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now