LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-10-2009, 01:52 PM   #31
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16

Quote:
Originally Posted by i92guboj View Post
A bit about semantics: the bool loader is a small piece of code that is usually put into the first sector of a disk or a partition. It takes a few bytes only, and its only task is to load the kernel so the OS can continue booting.

Now, to the point: are you sure that what you want to backup is the "boot loader"? Or do you mean to do a backup or your whole windows installation? These are two very different things.
Not sure how to answer there i92 - I THINK the boot loader.

I want to create a custom CD/DVD for Vista, instead of the factory reinstallation DVD (that I already have), which is loaded with bloatware.

If I lose Vista for some reason, I can boot Ubuntu, insert the DVD, and COPY bit-by-bit/byte-by-byte, back to the 2nd hard disk, to not actually re-install, but to recreate it as it is now. Cloning I guess would be a good word...

Do I have you confused yet?

Last edited by buccaneere; 02-10-2009 at 01:54 PM.
 
Old 02-10-2009, 02:02 PM   #32
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by buccaneere View Post
Not sure how to answer there i92 - I THINK the boot loader.

I want to create a custom CD/DVD for Vista, instead of the factory reinstallation DVD (that I already have), which is loaded with bloatware.

If I lose Vista for some reason, I can boot Ubuntu, insert the DVD, and COPY bit-by-bit/byte-by-byte, back to the 2nd hard disk, to not actually re-install, but to recreate it as it is now. Cloning I guess would be a good word...

Do I have you confused yet?
Then you want to backup your windows installation as a whole, and not the bootloader. Something in the lines of what you can do with norton ghost and similar tools under windows.

For this, you must use the tool called "dd", as I instructed you in another post above. The only thing you need is enough free space to store the image created with dd. Then if you wish you can compress it, cut it, burn it to a cd or whatever you want.

To create the image you do

Code:
dd if=/dev/sdb1 of=$HOME/backup.img
To restore it you'd do:

Code:
dd of=/dev/sdb1 if=$HOME/backup.img
As mnemonic note you can consider that "if" is the "input file" while "of" is the "output file". Simple enough. This will make a 1:1 copy of the data of the origin disk and save it to a file, so you can restore your system exactly as it is now at any given time.

By the way, how are you booting Windows? Do you use the linux loader to select it (grub, lilo)?
 
Old 02-10-2009, 03:53 PM   #33
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16
Copy on the backup... Thanks, and thanks for the help too.

This machine had a resume display bug, and shutdown bug, both gone now. Wish I knew the fix/workaround, cause lots of folks have this on HP dv xxxx laptop series...

This is GRUB now:
(2 hard disks in laptop)

Code:
## ## End Default Options #### ## End Default Options ##

title		Ubuntu 8.04.1, kernel 2.6.24-21-generic
root		(hd0,1)
kernel		/boot/vmlinuz-2.6.24-21-generic root=UUID=cbf87cd3-0a1f-40cd-8fe8-dbc4adc13ba5 ro quiet splash noapic irqpoll noirqdebug
initrd		/boot/initrd.img-2.6.24-21-generic

...
...
...

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title		Microsoft Windows XP Professional
root		(hd0,0)
savedefault
makeactive
chainloader	+1

title           Windows Vista
root            (hd1,0)
savedefault
makeactive
chainloader     +1

title		Ubuntu 8.04.1, kernel 2.6.24-21-generic
root		(hd0,1)
kernel		/boot/vmlinuz-2.6.24-21-generic root=UUID=cbf87cd3-0a1f-40cd-8fe8-dbc4adc13ba5 ro quiet splash noapic irqpoll noirqdebug
initrd		/boot/initrd.img-2.6.24-21-generic

...
...
...

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title		Microsoft Windows XP Professional
root		(hd0,0)
savedefault
makeactive
chainloader	+1

title           Windows Vista
root            (hd1,0)
savedefault
makeactive
chainloader     +1
 
Old 02-10-2009, 04:12 PM   #34
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
If you use grub as the boot loader all you should need to backup is your vista partition, as I explained on the previous post.
 
Old 02-18-2009, 11:34 PM   #35
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by i92guboj View Post



If you truly want to make a raw image (kind of like ghost images in windows) use the command "dd". You need to create an intermediate file, and then you can burn it to a cdrom with whatever program you prefer. In general terms, you can't use "cp" to write to blank cdroms.


Code:
dd if=/dev/sdb1 of=$HOME/win.img
Now after some other problems addressed, I'm ready to make backup boot disks for 2 Windows installs.

1) What is '$HOME/win.img'? Is this the WHOLE Windows partition - boot image, personal data, the entire Windows partition, etc.? Can only the data necessary for booting be extracted to burn? I backup all personal stuff on other machines...

2) What CLI code will return the partition information (the 'input file' info/location)?
 
Old 02-19-2009, 05:59 AM   #36
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by buccaneere View Post
Now after some other problems addressed, I'm ready to make backup boot disks for 2 Windows installs.

1) What is '$HOME/win.img'?
As per my other post, of='$HOME/win.img' means that $HOME/win.img will be used as the output file. What WILL be inside that file depends on what do you use as input, of course, so, if='/dev/sdb1' takes care of that part, and it means "use the first primary partition in the second IDE drive as input.

Translated to human language, this means that a file called win.img in your home directory will end containing the whole contents of of the first primary partition in your second IDE hard disk. I hope this clears it out.

Quote:
Is this the WHOLE Windows partition - boot image, personal data, the entire Windows partition, etc.? Can only the data necessary for booting be extracted to burn? I backup all personal stuff on other machines...
Yes. Except that there's nothing like what you call "boot image". To boot windows you need the contents of the Windows partition. You can save the boot sector, and the kernel, but that will not help you at all. That you saved your personal data here is irrelevant, you still need windows to boot windows, and not just a "boot image". Strictly speaking, you could save the \Windows and \"Program files" along with all the hidden stuff in \, and be done with that. I have no idea if grub will be able to boot with that alone. I've been away from Windows quite a lot of time so I don't remember the details. However I know for sure that if you install it into another drive it won't boot because windows likes to store paths everywhere in the registry and config files, and won't boot if these paths change.

Quote:
2) What CLI code will return the partition information (the 'input file' info/location)?
fdisk -l will list all your partitions
 
Old 02-20-2009, 10:39 PM   #37
buccaneere
Member
 
Registered: Nov 2007
Posts: 213

Original Poster
Rep: Reputation: 16
Copy on that. Fully.

I once did the bit-by-bit cp task, to a spare HD (still got it). To test, I plugged it into an external USB enclosure, and set BIOS to boot from it. It started to load Windows (XP), but after a few minutes, it 'encountered a problem'.

That seemed to indicate that it had copied correctly, but, like you say, 'hardware paths' didn't jibe, so it stopped the boot.

I imagine it would work, if I reversed the cp task back to the native disk, but had no reason to invite trouble right then.

I'd like to free up that extra HD if I can get the 'bootable' onto a CD/DVD.

I think Partimage.org/Main_Page has an app for just the image burning task...

Thanks again there!
 
Old 02-21-2009, 11:30 AM   #38
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
There are some caveats to using the dd command for disk imaging. First, you can use dd as i92guboj suggested, to image a partition (dd if=/dev/sdb1 of=/backups/images/sdb1) and to restore it (dd if=/backups/images/sdb1 of=/dev/sdb1) provided the output partition type is the same and the size exactly matches, or is larger than, the original partition. The point is, you're writing directly to the disk so every byte you write must got to the correct location, and the type of the output partition must correctly correspond to the type specified in the partition table.

You can also image the whole disk (dd if=/dev/sdb of=/backups/images/sdb), but now you are imaging the boot sector and partition tables, so the restore (dd if=/backups/images/sdb of=/dev/sdb) will recreate all that information on your destination hard drive. So, again, that drive must be at least as large as the source drive. And, since you are moving the partition table, unless the destination drive is physically identical to the drive of which you took the image, you will, generally, need to repair the partition table of the new drive. (The last time I restored a full drive image to a larger drive, I found that gparted could fix the discrepancies in the partition table. Both qtparted and parted itself wer unable to cope with the "bad' partition table.)

Oh, FYI, Vista has a boot loader program (C:\bootmgr) that corresponds to the Linux Initial RAM Disk image, and, IIRC, XP (and older NT based systems) use C:\WINDOWS\SYSTEM32\NTLDR.COM.
 
  


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
fedora 10 install via hard disk got a wrong message!---Missing ISO 9660 image netyq Linux - Newbie 1 01-31-2009 09:28 AM
View hard disk size command mpmackenna Linux - Newbie 3 09-27-2007 04:56 PM
Hard drive space filled, X fails, says connection reset by peer solar_64131 Linux - Software 5 08-28-2006 04:37 PM
Hard disk not bootable after GRUB's wrong operations linuxgaga Linux - Hardware 4 04-16-2006 11:00 AM
What's wrong with my hard disk?: prad Linux - General 3 03-05-2003 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:49 PM.

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