FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 04-26-2012, 01:58 PM
Martin McCormick
 
Default Installing the MBR on a new Hard Drive

I have made a copy of the / file system from the boot
drive on a Debian Squeeze system to a new flash drive as the
original drive is about 13 years old, works fine, but I don't
want to push my luck too far. I used fdisk to format the new
drive, made Partition 1 bootable and then used rsync to copy all
the files one can from the old drive to the new one.

It came time to install a MBR on the new drive so I
found some instructions which raise a question.

I know you are supposed to copy the image of a boot
floppy to the first 446 bytes of the new drive which is what I
did. This is done by

# dd if=/dev/hda of=/dev/sdb bs=446 count=1

It appears to have worked but I have not yet installed
the drive in the system and booted from it but there was also an
alternative instruction:

# dd if=/dev/hda of=/dev/sdb bs=512 count=2

What, besides the obvious fact that one is copying more
bytes, is the difference between copying just the MBR and
copying the 1024 bytes?

Was this even necessary since I had already made
fdisk set Partition 1 bootable before doing mkfs?

For anybody interested in doing this, make sure you know
your drive device designations as they will be different than
what I used in this example and you could really mess up your
day if you don't be careful.

Martin McCormick


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201204261358.q3QDwn2j028250@x.it.okstate.edu">http ://lists.debian.org/201204261358.q3QDwn2j028250@x.it.okstate.edu
 
Old 04-26-2012, 02:02 PM
Martin McCormick
 
Default Installing the MBR on a new Hard Drive

I have made a copy of the / file system from the boot
drive on a Debian Squeeze system to a new flash drive as the
original drive is about 13 years old, works fine, but I don't
want to push my luck too far. I used fdisk to format the new
drive, made Partition 1 bootable and then used rsync to copy all
the files one can from the old drive to the new one.

It came time to install a MBR on the new drive so I
found some instructions which raise a question.

I know you are supposed to copy the image of a boot
floppy to the first 446 bytes of the new drive which is what I
did. This is done by

# dd if=/dev/hda of=/dev/sdb bs=446 count=1

It appears to have worked but I have not yet installed
the drive in the system and booted from it but there was also an
alternative instruction:

# dd if=/dev/hda of=/dev/sdb bs=512 count=2

What, besides the obvious fact that one is copying more
bytes, is the difference between copying just the MBR and
copying the 1024 bytes?

Was this even necessary since I had already made
fdisk set Partition 1 bootable before doing mkfs?

For anybody interested in doing this, make sure you know
your drive device designations as they will be different than
what I used in this example and you could really mess up your
day if you don't be careful.

Martin McCormick


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201204261402.q3QE23lZ028319@x.it.okstate.edu">http ://lists.debian.org/201204261402.q3QE23lZ028319@x.it.okstate.edu
 
Old 04-26-2012, 02:28 PM
Martin McCormick
 
Default Installing the MBR on a new Hard Drive

Very sorry for the duplicate posting. It looked like the first
attempt bounced so I re-sent it and both worked.

Martin


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201204261428.q3QESHGi028554@x.it.okstate.edu">http ://lists.debian.org/201204261428.q3QESHGi028554@x.it.okstate.edu
 
Old 04-26-2012, 02:37 PM
Gary Dale
 
Default Installing the MBR on a new Hard Drive

On 26/04/12 10:02 AM, Martin McCormick wrote:

I have made a copy of the / file system from the boot
drive on a Debian Squeeze system to a new flash drive as the
original drive is about 13 years old, works fine, but I don't
want to push my luck too far. I used fdisk to format the new
drive, made Partition 1 bootable and then used rsync to copy all
the files one can from the old drive to the new one.

It came time to install a MBR on the new drive so I
found some instructions which raise a question.

I know you are supposed to copy the image of a boot
floppy to the first 446 bytes of the new drive which is what I
did. This is done by

# dd if=/dev/hda of=/dev/sdb bs=446 count=1

It appears to have worked but I have not yet installed
the drive in the system and booted from it but there was also an
alternative instruction:

# dd if=/dev/hda of=/dev/sdb bs=512 count=2

What, besides the obvious fact that one is copying more
bytes, is the difference between copying just the MBR and
copying the 1024 bytes?

Was this even necessary since I had already made
fdisk set Partition 1 bootable before doing mkfs?

For anybody interested in doing this, make sure you know
your drive device designations as they will be different than
what I used in this example and you could really mess up your
day if you don't be careful.

Martin McCormick


Personally, I'd just dd the entire old disk to the new one. Then use
gparted (from a live distro) to resize your partitions.


However, since you have already done it differently, you don't need to
dd the mbr. Instead, install grub on the new drive (again, boot from a
live distro). Create a chroot environment for your new / partition and
install grub from it.



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

Archive: 4F995DA9.5010202@rogers.com">http://lists.debian.org/4F995DA9.5010202@rogers.com
 
Old 04-26-2012, 08:11 PM
Martin McCormick
 
Default Installing the MBR on a new Hard Drive

Gary Dale writes:
> Personally, I'd just dd the entire old disk to the new one. Then use
> gparted (from a live distro) to resize your partitions.

Actually, that is probably the best solution. I did that on a
previous disk several months ago and it worked fine

> However, since you have already done it differently, you don't need to dd
> the mbr. Instead, install grub on the new drive (again, boot from a live
> distro). Create a chroot environment for your new / partition and install
> grub from it.

Thanks for the good suggestions. I have one more old
system that needs a new boot drive so I will probably dd that
one and then resize as the new drives are about 5 gigabytes
larger.


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 201204262011.q3QKBhE8030830@x.it.okstate.edu">http ://lists.debian.org/201204262011.q3QKBhE8030830@x.it.okstate.edu
 

Thread Tools




All times are GMT. The time now is 09:58 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org