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

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



ok then, just clarifying (don't want to screw this up):

On 9/20/05, Alvin Oga <aoga@mail.linux-consulting.com > wrote:


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 "

can't find sdisk with apt-cache search, and google gives strange answers -- is that a typo?  also, can you flesh out : "cat file | fdisk" ? say I want to copy contents of /dev/hda1 to /dev/hdb1 -- do I do the following:
fdisk /dev/hdab -- set up partition /dev/hdb1 as ext2/3
cat /dev/hda1 | fdisk....  something?  I don't quite get it. 

> } 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

there isn't much mem on these machines, probably need a swap (even though it will slow things down I reckon)
 

> } 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


gaaah!  thanks for this!  

> } 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

ok, so again to clarify:

mount /dev/hda1 /mnt/master
mount dev/hdb1 /mnt/slave
tar /mnt/master
cd /mnt/slave
tar -x ~/master.tar
grub-install /dev/hdb

Is that right?  (ok, so the disk set up describedh ere is a little screwed up.  in reality I have 2 ide buses in my home workstation; I've installed ubuntu on /dev/hde1; so I would do something like this:

mount /dev/hde1 /mnt/master
tar /mnt/master/
shutdown -h now
[take out /dev/hde, install 2 of the new disks; reboot, format them with fdisk as above]
mount /dev/hde1 /mnt/slave1
mount /dev/hdf1 /mnt/slave2
cd /mnt/slave1; tar -x ~/master.tar
cd /mnt/slave2; tar -x ~/master.tar

repeat as necessary

does that sound right?

thanks,

matt
 

c ya
alvin


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: