Slackware This Forum is for the discussion of Slackware Linux.
|
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
07-27-2006, 09:22 AM
|
#1
|
Member
Registered: Aug 2005
Location: Sheffield, UK
Distribution: Gentoo
Posts: 105
Rep:
|
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.
|
|
|
07-27-2006, 09:31 AM
|
#2
|
Slackware Contributor
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559
|
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
|
|
|
07-27-2006, 09:55 AM
|
#3
|
Member
Registered: Aug 2005
Location: Sheffield, UK
Distribution: Gentoo
Posts: 105
Original Poster
Rep:
|
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?
|
|
|
07-27-2006, 11:36 AM
|
#4
|
Member
Registered: Feb 2004
Location: Southern Maine, United States
Distribution: Slackware Ubuntu Debian FreeBSD
Posts: 418
Rep:
|
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.
|
|
|
07-28-2006, 01:12 AM
|
#5
|
Member
Registered: Apr 2006
Location: A comfy chair...
Distribution: Slackware
Posts: 111
Rep:
|
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.
|
|
|
07-28-2006, 03:16 AM
|
#6
|
Member
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480
Rep:
|
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.
|
|
|
07-28-2006, 03:29 AM
|
#7
|
Member
Registered: Mar 2005
Location: Right behind you.
Distribution: NBG, then randomed.
Posts: 480
Rep:
|
*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.
|
|
|
07-28-2006, 03:46 AM
|
#8
|
Senior Member
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
|
Quote:
Originally Posted by wilsonsamm
I'll want to find out how much space is used on the harddisk.
|
type 'df -h'
|
|
|
07-29-2006, 04:12 AM
|
#9
|
Member
Registered: Feb 2002
Location: India
Distribution: Slacky 12.1, XP
Posts: 992
Rep:
|
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
|
|
|
07-29-2006, 05:06 AM
|
#10
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,519
Rep:
|
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/
|
|
|
All times are GMT -5. The time now is 10:21 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|