[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: quickly partition disk, copy an image, install grub




On Tue, 20 Sep 2005, Gregory Seidman wrote:

> } fdisk /dev/hdb, and set up / and swap partitions

faster way to copy partitions from one disk to another is
with sdisk or  "cat file | fdisk "

> } mkswap /dev/hdb5 	# do I need to do this?

no .. swap partition is optional, and if you have enuff
mem for all your thingies your pc will be doing, it won't
randomly crash on you

swapp partitions might be of major issue on usb-sticks and cf
when you need all the bytes to squeeze in the kitchen sink

> } dd if=/path/to/image of=/dev/hdb1  # will this work if the partitions 	

the problem with low level copying a disk to another with dd...
a) you're assuming thre is no defects in the master
   and no defects in the clone
	- if there is a bad sector in either, you lost 512bytes of data
	and you will never know about the loss of data, unless you
	did a diff -r /master /clone

b) you'd be copying and reformatting the target to be the same
   as the master ..  ( ie .. if your clone is bigger disks, you're
   wasting space on the clone )

.. more whackyness

> }       				   # are not of exactly equal size?
	
when using dd, yo do NOT need to format the clone since you're
doing it by copying the old data ( image ) into the new disk

> } dd if=/dev/hda of=/dev/hdb bs=448 count=1  # does this install GRUB?

yoou just wiped up partition 4

you should be using bs=446 instead of 448 .. BIG difference

> } so, my question is:  is this the right way to go about this?  am I
> } missing any steps?  is there a better way to do it?

yes ... it just depends on what you're comfy doing 

i prefer ( tar master ) | ( cd clone ; tar extract )
	and use lilo or grub to reinstall the mbr

c ya
alvin



Reply to: