LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-27-2006, 09:22 AM   #1
wilsonsamm
Member
 
Registered: Aug 2005
Location: Sheffield, UK
Distribution: Gentoo
Posts: 105

Rep: Reputation: 15
Making a boot .iso using 'dd' and a working installation


So, I've got my Slackware distro up and running, and since I mess it up quite often, I thought I might just make a quick fix.

My plan is to make an exact copy of my hard disk to a raw file, which I can then burn onto a CD. The CD would be identical to my harddisk, complete with boot sector and the lot. Everything apart from swap is on the same partition.

Would it boot, though? Because Grub on the CD would probably try to boot slackware on the hard disk, because the config file would still be the same.
 
Old 07-27-2006, 09:31 AM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116
I very much doubt your hard disk would fit on a CDROM... furthermore, booting a hard disk and booting a CDROM are so different that your plan will not work - the CD won't boot just like that.
Creating an image of your disk using "dd" is not a bad idea in itself. If at any time you restore that image to another harddisk (with equal capacity) that new disk will probably boot.

Eric
 
Old 07-27-2006, 09:55 AM   #3
wilsonsamm
Member
 
Registered: Aug 2005
Location: Sheffield, UK
Distribution: Gentoo
Posts: 105

Original Poster
Rep: Reputation: 15
I'll want to find out how much space is used on the harddisk. It's probably not much, but there's probably a load of stuff there that I don't need.

How does one go about making bootable cds, then?
 
Old 07-27-2006, 11:36 AM   #4
DaWallace
Member
 
Registered: Feb 2004
Location: Southern Maine, United States
Distribution: Slackware Ubuntu Debian FreeBSD
Posts: 418

Rep: Reputation: 31
Quote:
Originally Posted by wilsonsamm
I'll want to find out how much space is used on the harddisk. It's probably not much, but there's probably a load of stuff there that I don't need.

How does one go about making bootable cds, then?
what I did once for setting up ten machines in a lab was, first, zero (dd if=/dev/zero of=/dev/hdX) the hard drive so that the image I created later was smaller, I installed the system, imaged the hard drive using dd then I compressed and uploaded the image to a network server, then booted with a livecd and wrote it to the disks on the machines over the network.

you could write the hard drive image to a cd or dvd but it would not boot until it had been written to another hard drive. I guess it might work in certain drives on certain bioses, but it is not and will never be standard behavior.

for a bootable cd you need a burning app that supports it, cdrecord, xcdroast, whatever else, give it a bootable image, and it will create a bootable cd from that, I've never done it so I hope I was right.

Last edited by DaWallace; 07-27-2006 at 11:40 AM.
 
Old 07-28-2006, 01:12 AM   #5
Daga
Member
 
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111

Rep: Reputation: 15
Quote:
Originally Posted by wilsonsamm
My plan is to make an exact copy of my hard disk to a raw file, which I can then burn onto a CD. The CD would be identical to my harddisk, complete with boot sector and the lot. Everything apart from swap is on the same partition.
This is essentially what the linux-live scripts were created for. Have a look at http://www.linux-live.org

EDIT: OK, so it won't be like a dd image, but it would mirror all of the files/directories from your harddrive and turn them into a bootable CD.
 
Old 07-28-2006, 03:16 AM   #6
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
You might also find Mondo Rescue useful. The author did a presentation for NLUG awhile back and we found his change revision control technique pretty amusing.

He'd make his changes, then backup his hard drive and wipe it. If he couldn't restore his newest backup, the changes were obviously broken and restoring from his last backup took care of removing them.
 
Old 07-28-2006, 03:29 AM   #7
evilDagmar
Member
 
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480

Rep: Reputation: 31
*smacks forehead*

Also, it's not generally useful to make backups you intend to restore to other machines or drives with dd, because of potential disk size problems.

Tar can be relied upon to make perfect copies of filesystems (after all, it was written primarily for making backups in the first place), up to and including /dev and so forth. Tar files can be restored quite easily (excepting NTFS of course), once you've made the filesystems necessary. Just remember to copy the filesystems in reverse order to how they're mounted and unmount them as you go (or read the man page for tar to learn how to tell it not to backup the parts you've already copied) so if you have something like this in /etc/fstab:

Code:
/dev/hda9        swap             swap        defaults         0   0
/dev/hda5        /                reiserfs    defaults         1   1
/dev/hda15       /usr             reiserfs    defaults         1   2
/dev/hda10       /var             reiserfs    defaults         1   2
/dev/hda14       /tmp             ext2        defaults         1   2
/dev/hda19       /home            reiserfs    defaults         1   2
/dev/hda21       /space           ext3        defaults         1   2
Then you'll want to do something similar to the following...

Code:
tar -cf /space/backup-home.tar /home
umount /home
tar -cf /space/backup-usr.tar /usr
umount /usr
tar -cf /space/backup-var.tar /var
umount /var
tar -cf /space/backup-root.tar /root /etc /lib /bin /sbin /dev /boot /usr /var /home
The "/usr /var /home" stuff at the end is technically not necessary unless you're really absent-minded. It's just a lazy way of making sure the mount points for the other filesystems you backed up are recreated exactly as they were before.

...and you might want the machine in runlevel 2 before you go unmounting /var, depending on how picky you are.
 
Old 07-28-2006, 03:46 AM   #8
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally Posted by wilsonsamm
I'll want to find out how much space is used on the harddisk.
type 'df -h'
 
Old 07-29-2006, 04:12 AM   #9
jayakrishnan
Member
 
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992

Rep: Reputation: 30
http://www.linux-live.org/ doesnt create rescue disk , it just creates a live cd out of the install distro , or am i missing something :-s
 
Old 07-29-2006, 05:06 AM   #10
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519

Rep: Reputation: 63
Wilsonsamm,

If I understand you correctly, I believe I presently do exactly what you are asking for with my slow laptop. Let me bore you with details so you can see how I achieve what I think your looking for

I use a program called powerquest drive image and/or norton ghost depending on my needs or the mood I'm in. They create the compressed image files of my hard drive, and I can tell them how big the files should be, what compression level I want etc.

So For example: I can right now..reformat the hard drive, use a DOS script file to wipe the boot sector (now there is no lilo or grub (grub is not friendly to boot sectors IMO) and there are no partitions. I prefer to wipe the boot sector clean as a good measure. It's not required I just do it.

Then I use partition magic or FDISK to make my linux swap file so that Linux's fstab doesn't have a canary on me when I boot up later. Then I just restore the images off my cd's(effectivly they are just big compressed files the size of a cd or whatever I tell it to be, it can be an HD or DVD too). Then I just boot up the pc with my slackware floppy disk or cd1..get to the root prompt, log-in as root, then run 'lilo' and I'm done.

Note: I didnt make a "/" partition as the drive image or ghost make it for me automatically.

Note2: If I had another partition let's say my "home" on /dev/hda3, then after I restored my "/" I would then make a partition with partition magic for my "home" before I loaded into slackware off the boot disk or cd1. This would apply for any other partitions I may have, /tmp /var, etc etc.

For example: My laptop has 6 gig hard drive, compressed in an image is 2.5 cd's. My cdrom is only 12 spin, and I can restore and be back up in under 30 minutes or so, give or take.

In fact: my norton ghost allows me to use a DOS based network driver that can access a samba share, it see's the image files and I use the ghost cast feature - no cd's or disks required, except the ghost cd to initially boot the laptop up.

Tho those app's I mentioned are closed source proprietary, but Alien Bob has a program on his site that I believe is will do the cd split sizing and image creation for you. I am hoping to use it soon when I get more time. Actually, I was going to use it once, but because I'm not a linux pro yet I got scared off when the application wanted to do a bunch of GPG stuff to embed in my images, which I personally don't need to do, but you might like it or need it depending on your data on your images. I just havent had the time to go thru my own testing and learn how to restore GPG key's yet on it yet is all

Alien Bob hosts his package for this at:
http://www.slackware.com/~alien/slackbuilds/partimage/
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Got the ISO working...Now How to set up dual boot xp and suse 9.3 smattmac Linux - Newbie 6 06-10-2005 05:17 PM
Installation from boot.iso CD freezes jfi Mandriva 3 05-11-2004 04:06 PM
Problem when making an installation boot CDROM... Alf829 Linux - General 3 02-17-2004 02:41 PM
checksum error when trying to boot red hat version 9 burned installation iso cd dorn Linux - Laptop and Netbook 3 10-27-2003 11:29 AM
Help making and ISO out of a boot disk image... Rikarus Linux - Software 2 05-20-2003 04:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:21 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