LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-27-2002, 10:36 AM   #1
jkcunningham
Member
 
Registered: May 2002
Location: Seattle, WA, USA
Distribution: Gentoo
Posts: 136

Rep: Reputation: 15
How do I swap a hard disk w/o reinstalling?


I have SuSE 8 installed on a system with two hard disks. One of the hard disks (unfortunately, the one it boots from) is getting flakey and needs to be replaced. Is there a way to move everything off that hard disk to the other (which probably has enough space) so I can take out the bad drive and put in another? I'd rather not do an entire reinstall if I can help it.

Regards

Jeff
 
Old 05-27-2002, 02:32 PM   #2
Noerr
Member
 
Registered: May 2002
Location: Dalec, HU
Distribution: Redhat 7.3
Posts: 696

Rep: Reputation: 30
you have several solutions
easy one:
get norton ghost 7.5 (if fs=ext3, otherwise can be older), put it on floppy and boot your system and choose partitions to copy

fun one:
cfdisk/fdisk make partitions you need on new disk + reboot
mkfs /dev/hdb1 .... ( format new partitions)
mount /dev/hdb1 /mnt/newdisk .. (mount new disk to newdir)
if have more partitions make new dirs and mount ie
mkdir /mnt/newdisk/boot
mount /dev/hdb1 /mnt/newdisk/boot ...

cp -a /boot/* /mnt/newdisk/boot/
cp -a /bin /mnt/newdisk/
...

shutdown computer, remove old hard disk and boot with rh i386 disk 1
and prompt choose
linux rescue (your system will be mounted in /mnt/sysimage)
chroot /mnt/sysimage
(if you use lilo) run lilo
(if you use grub) run grub /dev/hda


good luck
 
Old 06-07-2002, 06:07 PM   #3
ngomong
Member
 
Registered: Apr 2002
Posts: 54

Rep: Reputation: 15
I went through the "fun one" system of moving disks.

However, when I boot with my rescue disk, it says there's a problem mounting my system.

If I try to boot directly, grub reports a hard disk error.

The partitions on my new disk are as follows:
/dev/hda1: /boot
/dev/hda2: swap
/dev/hda3: /

I can mount them by hand, and I've compared all the files between old and new drives... no problems there.

I think it might be a problem with the way I installed grub to the new disk.

Since I couldn't get the rescue disk to mount the new disk... I went back to my old one, put the new disk on /dev/hdb, and did a:
grub-install /dev/hdb

Didn't work.

Used rescue disk, mounted system by hand, did:
grub-install /dev/hda

Didn't work.

Thought it might be because my /boot is on a seperate partition. Did:
grub-install --root-directory=/boot

Didn't work.

Here's the /etc/fstab file from the new disk:
Code:
LABEL=/1                /                       ext3    defaults        1 1
LABEL=/boot1            /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda2               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              iso9660 noauto,owner,kudzu,ro 0 0
/dev/cdrom1             /mnt/cdrom1             iso9660 noauto,owner,kudzu,rw 0 0
I just used the same file as the old disk, and modified it slightly.

Strange thing is, when I mount the system by hand under the rescue environment, "df" reports entries for
/new-disk
/new-disk/boot
... with errors. That's how I mounted my new disk to copy over the files. Not sure why it is showing up under the new environment, since the /etc/fstab doesn't define those mount points.

Where's my problem?
 
Old 06-08-2002, 12:25 AM   #4
linuxcool
LQ Addict
 
Registered: Jun 2001
Posts: 1,183

Rep: Reputation: 47
ngomong, shouldn't that line, grub-install --root-directory=/boot, be
grub-install --root-directory=/boot /dev/hda.

Last edited by linuxcool; 06-08-2002 at 01:31 AM.
 
Old 06-09-2002, 09:55 PM   #5
ngomong
Member
 
Registered: Apr 2002
Posts: 54

Rep: Reputation: 15
Oops... yeah, you're right. I forgot that bit when making my post.

However, I _did_ do it properly when trying to get my disk to work.

I've decided to just use mondo-rescue to image my system, then restore to the new disk.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cloning 1 hard disk to smaller hard disk, dd or ghost? fireman949 Linux - Hardware 8 12-23-2012 12:51 AM
Reiser file system / Hard Disk/ Hard Drive Problems Oxyacetylene Linux - Software 4 10-10-2005 02:24 PM
Can you Swap motherboards w/o reinstalling? lsgko Linux - Hardware 2 03-05-2004 01:25 PM
Add Hard disk for swap space with problems in boot sector rkes7 Linux - Hardware 1 01-25-2004 02:41 AM
Hard Disk question - Making a big hard disk MrAnonym Linux - General 2 09-15-2003 06:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration