LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 01-26-2007, 01:42 AM   #1
hs.chauhan
LQ Newbie
 
Registered: Jan 2007
Distribution: Mandriva 2005 Limited Edition
Posts: 1

Rep: Reputation: 0
How to create bootable partition image to burn


Dear all,

I recently installed ubuntu LTS 6.06 after my mandriva distro was fried up. Now I have got everything in place but through the network installation. So I don't have the packages. My root partition where I install everything (home parition is different) is about 3.8 GB filled up. Can I create an bootable image of the partition (byte-by-byte copy)? So that if anything goes wrong, I can byte-by-byte copy the image back on the bootable root partition and restore the system again?

Thanks,

Regards
--Himanshu
 
Old 01-26-2007, 07:46 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
What do you mean by "bootable root partition" in this context? Linux does not use the active flag as in Windows.
How is this system set up--eg is there a dual-boot with Windows? Where is the bootloader installed? eg in the mbr or in the boot sector or you Linux partition?

To clone a partition, the dd command can be used. It does not compress, so you will need disk space big enough.

Search here at LQ for a really good tutorial on dd by AwesomeMachine
 
Old 01-26-2007, 11:01 AM   #3
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Pretty easy actually. Here are the steps

(1) Get hold of a spare hard disk in an external enclosure so that it works as an external hard disk via a USB port.

(2) Run cfdisk program in Linux and create a partition identical size to the partition you want to clone. Say external partition is sda1 and the partition to be cloned is hda3.

(3) clone the partition by command
Code:
dd if=/dev/hda3 of=/dev/sda1
Please note

(a) It is imperative that the sda1 is exactly the same size as hda3. You can ask cfdisk to display the exact sector or Mb size to match the two.

(b) Adding the block size parameter "bs=32768" can improve the transfer rate. Without it dd defaults to bs=512 bytes and each transfer is one complete sector. 32768 = 63 sectors times 512 or one complete track to be cloned at a time.

(c) If you want an easy job clone the whole disk. Just make sure the target disk is exactly equal or larger than the source disk. Drop the number in the partition reference, i.e input file = hda and output file = sda. dd will not work if the taget disk is smaller as the an OS cannot cope with a hard disk showing partition size larger than it physical size.

(d) If the whole disk is cloned it can replace the original disk and boots exactly the same. The excess capacity become unallocated space which can be incorporated into existing partitions by gparted or Parted Magic software.

Last edited by saikee; 01-26-2007 at 11:04 AM.
 
Old 01-26-2007, 02:54 PM   #4
Tortanick
Member
 
Registered: Jul 2006
Distribution: Debian Testing
Posts: 299

Rep: Reputation: 30
I think
Code:
dd if=/dev/hda3 of=/home/hda3.img
will create a file containing you're hard drive image. then to restore just do it in reverse
Code:
dd if=/home/hda3.img of=/dev/hda3
I'd wait for someone to confirm this before trusting you're soul backup to this method. And it goes without sadying that hda3.img should be stored safely on a different hard drive.
 
Old 01-26-2007, 04:39 PM   #5
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
A lot of the suggestions above were mentioned and scrutinized in this thread link below, I made a suggestion towards newer technology which apparently made the thread starter "giddy". I have stress free computing environment with this stuff. I do not ask questions at LQ because I solve my own problems with this. It gives me the freedom to hack away hard without any worries.

http://www.linuxquestions.org/questi...d.php?t=519444

http://www.bootitng.com/

Last edited by Junior Hacker; 01-26-2007 at 04:58 PM.
 
Old 01-26-2007, 05:31 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by Tortanick
I think
Code:
dd if=/dev/hda3 of=/home/hda3.img
will create a file containing you're hard drive image. then to restore just do it in reverse
Code:
dd if=/home/hda3.img of=/dev/hda3
I'd wait for someone to confirm this before trusting you're soul backup to this method. And it goes without sadying that hda3.img should be stored safely on a different hard drive.
Don't try to make an image, clone, etc. of the partition you are using. The above works if /dev/hda3 is not in use.
 
Old 01-26-2007, 05:42 PM   #7
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I am just curious why people would want to put a partition of 3.8Gb image into a file and not in a partition.

If the information is in a partition as I suggested Post #3 it is already in a separate disk. You can mount it to select individual files to restore. The whole idea of using dd is to copy the binary pattern of the partition and that includes its boot sector which normal backup software does not touch. Therefore with the boot sector and filing system in a mirror image available for access must be a huge advantage over saving the entire partition just to a binary file of the same size but cannot be mounted for data retrieval.
 
Old 01-26-2007, 05:53 PM   #8
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
saikee

What the thread starter is after is to back up his operating system, if you back up to the same HDD, in the event of a HDD failure, you have no back up. What he/she may want is to back it up to CD/DVD. The link I provided gives you many back up mediums to choose. And if an individual were to use this newer technology to create/manage all partitions, lilo or grub would be installed in first sector of root partition and will also be backed up. You can also use the same image to install multiple copies of any OS to use for testing without harming your original copy.

That's where stress free computing comes into effect.

Last edited by Junior Hacker; 01-26-2007 at 06:04 PM.
 
Old 01-26-2007, 05:53 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by saikee
I am just curious why people would want to put a partition of 3.8Gb image into a file and not in a partition.
Not me!!! I don't backup OSes--only data (with tar)

If I had a dying drive or some other situation requiring heroic data recovery efforts, I would simply clone the whole drive.
 
Old 01-26-2007, 06:24 PM   #10
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Junior Hacker,

My Post #3 suggests backing up with an external hard disk!

I don't think you understand what dd, one of the oldest commands in Linux, can do if you think of other software as "new" technology.

If you run a terminal command of "hdparm -tT /dev/hda" it will tell you the maximum transfer rate is about 60Mb/s for a modern Pata disk.

dd copies the "1" and "0" of the hard disk at about 50 to 55Mb/s and that is not easy to match by any commercial software. dd clones the exact mirror image of the partition or hard disk and there is nothing better than 100% of the original, is it?

Any DVD or CD recording of a hard disk operating system will not boot because the partition and disk number cannot be matched.

I run the maximum number of 63 partitions in my Pata disk and 62 of them will be filled with OSs except the extended partition. There can be Dos, Windows, Linux, BSD and Solaris among the 63 partitions. The way I upgrade my hard disk is to buy a bigger than, dd the entire disk, put away the original as the backup and start using the clone disk right away. I never expect any of the OSs fail to boot. I use dd to move Linux from partition to partition, from hard disk to hard disk and from computer to computer. I have tried a couple of comercial software but didn't find them anywhere as simple or powerful of dd, which is a fundamental tool available in every Linux or the Unix-based system.

To me the new technology is for users who donot want to bother with the basics in Linux.

Also you may like to know that only dd can read and save data from a dodgy hard disk on the verge of a hardware failure because we can control the DMA and slow down the hard disk speed to get more reliable reads and skip unreadable information. Good sectors of a bad disk are always saved by dd any way.

If you have new technology to beat that let us know.
 
Old 01-26-2007, 06:47 PM   #11
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
Do some reading, I provide links.
You want to stay in the past, stay in the past. Yes dd is one of the oldest commands, which makes it ancient technology. I've been using bootitng for two years now and it is FLAWLESS. As I mentioned in the other thread, I can wipe 0's across a partition and restore a clean, fresh, fast, fully updated and configured backed up copy of an original install in less than "TEN MINUTES". Don't convince yourself the old technology is better, technology marches on. Backing up to CD/DVD is just that, "a backup", you do not boot from it, you restore from it to original HDD or new. As I mentioned above, if you want to boot multiple copies of the same OS, you can.

DON'T KNOCK IT TILL YOU TRY IT

Last edited by Junior Hacker; 01-26-2007 at 06:51 PM.
 
Old 01-26-2007, 06:54 PM   #12
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Junior;

I can tell you any number of people on this forum that I might talk down to, but Saikee would not be one of them. My world is still pretty small, but I have yet to see him give bad advice.

It makes me a bit cautious to see someone really pushing (eg) Bootitng, when I never saw it on this forum until you mentioned it.
 
Old 01-26-2007, 07:20 PM   #13
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
That's because humans are afraid and hate CHANGE

I do not condone anything he say's, I merely point out there are other options which can be far superior. Have you ever asked yourself why third party software designers launched a large lawsuit against Microsoft?

Perhaps.....
It is because their technology is worth protecting so the giants don't implement this better technology in their systems and profit??????
Maybe I don't see what you see, maybe you don't see what I see.
 
Old 01-26-2007, 08:00 PM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Don't talk about the belief. Give us some facts.

I have quoted dd can clone systems at 50Mb/s speed. Most of my systems are in 5Gb partitions and restoring one takes 5000/50 = 100 seconds or 1.66 minutes. With 10 minutes dd can restore an OS as large as 30Gb. Cloned a 400Gb disk yesterday in 7754 seconds and that is 51.6Mb/s speed. Let the figures speak for themselves.

There is nothing old in Linux. It is just a set of tools with which many new programs are based on. You may be presently surprised some of the new technology uses dd as the engine.

I have no interest in wining the argument but it would be sad if the forum members think there is a newer and better technolgy in copying the binary pattern of "1" and "0" off a hard disk than a Linux kernel can do in its simplest and most direct read and write.
 
Old 01-30-2007, 08:39 PM   #15
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 59
I stand corrected:

I visited bootitng's site today to get latest copy for upgrade, and found the products do have the ability to boot from CD/DVD.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to burn bootable CD from ISO image in windows rs5979 General 5 01-27-2007 11:19 AM
What file do I burn to create a bootable cd for RedHat 9 Jacksenflamed Linux - Newbie 1 03-15-2004 05:17 PM
unable to create a bootable cd from iso image abhijit Linux - Newbie 4 09-01-2003 04:16 PM
How to burn a bootable image in Windoze ealpert1 Linux - General 5 05-19-2003 03:30 PM
burn bootable image from iso using RedHat 8 eggmcmuffin Linux - Newbie 5 02-06-2003 07:50 AM


All times are GMT -5. The time now is 07:00 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration