Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi all, this is going to be my 1st entry in this forum so any mistake i may do forgivme for it.
NEWBIE ALERT
So here's my problem:
I made a backup of my hard drive to my external disk using the command dd i done it like this:
dd if=/dev/sda of=/mnt/usbdrive/test.img
the copy was made without any errors, after that i tried to "recover" my hard drive with the same command:
dd if=/mnt/usbdrive/test.img of=/dev/sda
and my problems started, sometimes the "recover" finished but then when i reboot the OS wasnt working properly other times the "recover" didnt even end.
My hard drive has several disk partitions and i need them all that's why i used /dev/sda insted /dev/sda1 .
Ty in advance
Ps- I dont have cd-rom drive
Last edited by DuarteSilva; 10-13-2010 at 04:25 AM.
i got some other question about this "recover", when im making the "recover" of my hard drive with the dd command from my flash disk how it will be with the OS? I mean all the configurations will be like the OS from the flash disk? Or they will be like the current OS? Will i have trouble with that?
Dont know if i make me to understand myself, rigth now im making a copy of my hard drive with that command line u gave me.
First off dd isn't a good program to use for backups of an entire drive. It makes a byte for byte image of that disk. Which may sound good but it can cause problems and should only be used in certain situations and when you know what you are doing. It would be better to use a GUI program that will handle all the details for you or just tar which is how I do backups.
But anyways we need some more information. How big is the drive you are backing up? How many partition are on it? What is on them, an operating system or just data? How big is the flash drive you are saving the image to?
Quote:
i got some other question about this "recover", when im making the "recover" of my hard drive with the dd command from my flash disk how it will be with the OS? I mean all the configurations will be like the OS from the flash disk? Or they will be like the current OS? Will i have trouble with that?
Do you have a rescue linux distro installed on the flash drive? Well regardless the image will be an exact copy of whatever was on sda at the time you made the image. Whatever else in on the flash drive won't effect the image.
Quote:
after used dd if=/dev/sda of=/dev/sdb i had a error:
You don't want to run that exact command. Since it will copy the contents of the second hard drive onto the first. You want of= to be the image you made "test.img".
The drive Im backing up has 250 GB and it has 8 partitions, ther's a Linux OS, i will put the problem like this i need to have that OS and partitions in a USB hard drive for later use in other desktops that may have problems, my intention is to recover those desktops with problems all the desktops got the same functions/systems.
My USB drive has 160GB but from those 250 GB from my hard drive only 5 GB are being used from all partitions.
My flash drive is completly empty.
Question: Lets say i got something in the flash drive (sdb) and i do dd if=/dev/sda of=/dev/sdb , what will happen with the other things in there? And after i do that command if i do the if=/dev/sdb of=/dev/sda what will happen with the things that were already in the flash drive? They will also be replicated into the hard drive(sda)?
Okay I see what you want to do know. But you can't use dd to do it. dd will just copy the first 160GB of the 250GB hard disk to the flash drive. And it wont be the actual used space it will just be the first 160 billion bytes of data. Even if the data is just 00000000. dd does a byte for byte copy, it doesn't care if it is actual data or just padded zeros, it will copy it over.
Well it may still be possible to use dd if you really want to. You can compress the image you make with dd then copy it to the flash drive. According to the man page if you omit `of=` it will just write it to stdout. Then you can pipe that through bzip. So something like `dd if=/dev/sda | bzip2 -c > sda.bz` might work. Then to restore it you could do `bunzip2 -c sda.bz | dd of=/dev/sda`.
Note: I don't know if that would actually work but it is worth a try. I'm sure that there are programs to do what you want. If you do some googling you should be able to find something. I can't recommend anything since I've never used any.
Last edited by gammahermit; 10-14-2010 at 07:55 AM.
Taring only archives the files and directories not the filesystem or partition. So you would have to make a tarball (a tarball is just a tar archive compresses with gzip) of all the files in each partition. If you have 8 partitions you would have to make 8 tarballs for each of them. Then when you want to restore from the backups you would have to restore each tarball to the right partition overwriting the files. Unless there was a problem with the drive itself in which case you would first have to recreate all of the partitions then make a filesystem on each of them then mount them and finally unarchive the tarball in the correct mount point.
If you only had to backup one or two partition then tar would be a good way to do it. But since you have 8 it probably isn't the best solution.
It seems i made it done +/- properly, with the dd commnad piped with zip to make the backup, after I deployed the backup and i had some erros, but then i runed the fsck command in all partitions and the desktop started to work properly, dunno if is the best/fast way do make and deploy backups.
Any more advices/sujestions are welcome, mybe i will try the clonezilla.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.