lkml.org 
[lkml]   [2002]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Re[2]: Urgent SCSI I/O Error
On Mon, Feb 25, 2002 at 08:44:19PM +0000, Manohar Pradhan wrote:
> Hi All,
>
> If the Hard Drive is died, means I will need to replace. I have backup
> for the Data in that /www partition.
>
> Means when I replace new HDD, I will have to partition/format using
> fdisk /sda ?
>
> >From my partition info,
>
> /dev/sdb6 917072 732972 137516 84% /
> /dev/sda1 18820 5811 12037 33% /boot
> /dev/sda6 2218336 462492 1643156 22% /www
> /dev/sda5 5297560 418936 4609520 8% /home
> /dev/sda7 1210440 711516 437436 62% /software
> /dev/sdb1 5550188 50896 5217356 1% /usr
> /dev/sdb5 2016016 28572 1885032 1% /var
>
>
> My problematic HDD is /sda so if I replace this HDD, how can I boot as
> boot images are in /sda1 /boot partition. How can I copy this boot
> images to somewhere and make it work and what will be the process?

Plug in the new drive as well as the old one.

I assume the new drive will be /dev/sdc. And I assume you are running
RedHat 6.2 with LILO.

If you statically set the IDs on your disks, just make sure that the
new disk has a higher ID than the two others, then it will be /dev/sdc.

>
> I know if I reboot and replace the HDD, it will give problem while
> booting, any Idea to struggle with this?

# Create partitions on the new disk
sfdisk -d /dev/sda | sfdisk /dev/sdc

# Create filesystems
mke2fs /dev/sdc1
mke2fs /dev/sdc5
mke2fs /dev/sdc6
mke2fs /dev/sdc7

# Mount new filesystems
mkdir /mnt/boot
mount /dev/sdc1 /mnt/boot
mkdir /mnt/home
mount /dev/sdc5 /mnt/home
mkdir /mnt/www
mount /dev/sdc6 /mnt/www
mkdir /mnt/software
mount /dev/sdc7 /mnt/software

# Copy the boot filesystem
umask 0
tar cf - /boot | tar xCfp /mnt -

# Now, edit /etc/lilo.conf so that it
# contains something like:
boot=/dev/sdc
disk=0x80
map=/mnt/boot/map
# The boot and map lines are to be replaced, the
# disk line is to be inserted.

# Make the disk bootable - if this command
# complains, then I've overlooked something.
# Mail me back with the error message
lilo

# Now copy the other filesystems. Note, these
# copy commands may fail horribly when you run
# into the bad blocks !!! Don't worry, you have
# a backup...
tar cf - /home | tar xCfp /mnt -
tar cf - /www | tar xCfp /mnt -
tar cf - /software | tar xCfp /mnt -

# Now, your box may have died during the copying,
# or it may still be more or less alive. We
# don't care, it's time to lose the old drive.
# Now, power down, and unplug /dev/sda
# Move /dev/sdc so that it will be recognized as
# /dev/sda on boot.

That should be it ! (in theory at least)

You probably want to change back your lilo.conf, and
check the files you (possibly) copied from the broken
disk.

--
................................................................
: jakob@unthought.net : And I see the elder races, :
:.........................: putrid forms of man :
: Jakob Østergaard : See him rise and claim the earth, :
: OZ9ABN : his downfall is at hand. :
:.........................:............{Konkhra}...............:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.047 / U:11.952 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site