LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-14-2007, 02:44 PM   #1
hramat
LQ Newbie
 
Registered: Feb 2005
Location: The Netherland
Distribution: Fedora core 3, Arch Linux
Posts: 9

Rep: Reputation: 0
copying whole harddisk to new one


I am sorry if I am posting this post when it is already somewhere else, but I couldn't find it.

I have older laptop, I bought new harddisk. I wanted to copy old HDD to new one. I have copied all the content by partimage and subsequently restored grub. I had to change content of /boot/grub/menu.lst

from:
root (hd0,6)
kernel /boot/vmlinuz26 root=/dev/sda5 ro

to:
root (hd0,4)
kernel /boot/vmlinuz26 root=/dev/hda5 ro

I also changed sda5 to hda5 in /etc/fstab and /etc/mtab

while booting the system I got few errors referring to /dev/hda5 (while in the system is probably /dev/sda5).Here is one of them:
Error: root fs cannot be detected.
Root device '/dev/hda5' doesn't exist

It seems that the problem is different part of partition on disk

Does anyone have suggestion what I can do to correct those links.
Thank you for any help

matej
 
Old 10-14-2007, 03:06 PM   #2
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Changing root=/dev/sda5 to root=/dev/hda5 suggests you removed the old SATA drive and installed a PATA drive (different interface...connection). If you installed the same type of hard drive as the original, this should not have been changed.
Quote:
from:
root (hd0,6)
kernel /boot/vmlinuz26 root=/dev/sda5 ro

to:
root (hd0,4)
kernel /boot/vmlinuz26 root=/dev/hda5 ro
In the "from", you have root (hd0,6) which does not correspond with "root=/dev/sda5", is this a typo?

You could probably boot with the Fedora installation disk and type: linux rescue at the boot prompt after hitting the appropriate (Fx) key for other options. When you eventually get another prompt, type: fdisk -l and post the output of that command here. Also, can you post the /boot/grub/menu.lst file. This information should hold all the relevant information to configure things properly.
 
Old 10-14-2007, 04:01 PM   #3
hramat
LQ Newbie
 
Registered: Feb 2005
Location: The Netherland
Distribution: Fedora core 3, Arch Linux
Posts: 9

Original Poster
Rep: Reputation: 0
The disk type is the same, both are IDE-ATA disks, one is Seagate 100Gb and the old Toshiba 60Gb. It is in the laptop so I couldn't change type.
The system I am "restoring" is Arch Linux, so I am not sure if Fedora rescue would work.

the output of fdisk -l
Disk /dev/hda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1530 12289693+ 7 HPFS/NTFS
/dev/hda2 1531 6672 41303115 7 HPFS/NTFS
/dev/hda3 6673 12161 44090392+ 5 Extended
/dev/hda5 6673 11906 42042073+ 83 Linux
/dev/hda6 11907 12161 2048256 82 Linux swap / Solaris

Disk /dev/sda: 60.0 GB, 60011642880 bytes
255 heads, 63 sectors/track, 7296 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1275 10241406 7 HPFS/NTFS
/dev/sda2 1276 4108 22756072+ 7 HPFS/NTFS
/dev/sda3 4109 7296 25607610 5 Extended
/dev/sda5 4109 7143 24371392+ 83 Linux
/dev/sda6 7143 7296 1235776+ 82 Linux swap / Solaris


the output of old /boot/grub/menu.lst
# Config file for GRUB - The GNU GRand Unified Bootloader
# /boot/grub/menu.lst

# DEVICE NAME CONVERSIONS
#
# Linux Grub
# -------------------------
# /dev/fd0 (fd0)
# /dev/hda (hd0)
# /dev/hdb2 (hd1,1)
# /dev/hda3 (hd0,2)
#

# general configuration:
timeout 5
default 0
color light-blue/black light-cyan/blue

# (0) Arch Linux
title Arch Linux
root (hd0,6)
kernel /boot/vmlinuz26 root=/dev/sda5 ro
initrd /boot/kernel26.img

# (1) Windows
title Windows
rootnoverify (hd0,0)
#makeactive
chainloader +1


I have changed the (hd0,6) to (hd0,4) cause of output of grub command find /boot/grub/stage1.
I have changed sda5 to hda5 cause I have found that the copied arch linux on new HDD is on hda5
 
Old 10-14-2007, 04:20 PM   #4
hramat
LQ Newbie
 
Registered: Feb 2005
Location: The Netherland
Distribution: Fedora core 3, Arch Linux
Posts: 9

Original Poster
Rep: Reputation: 0
The problem is solved.
The mistake I made was in changing sda5 to hda5 in /boot/grub/menu.lst
I had to change only (hd0,6) to (hd0,4)

thanx a lot Junior Hacker
Actually, what is the difference between hda and sda?
 
Old 10-14-2007, 04:35 PM   #5
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
"what is the difference between hda and sda? "

hda is used to address devices attached to an IDE controller. sda is used to address devices attached to a SCSI controller.

--------------
Steve Stites
 
Old 10-14-2007, 05:59 PM   #6
Junior Hacker
Senior Member
 
Registered: Jan 2005
Location: North America
Distribution: Debian testing Mandriva Ubuntu
Posts: 2,687

Rep: Reputation: 61
Yes, and as of kernel 2.6.20, all hard drives are seen as SCSI regardless, not all distributions made this switch right away, some only implemented this in the 2.6.21 kernel etc., some probably still do not implement the change. So even if you have a PATA disk, if your distribution has implemented the change it will have to be /dev/sd(x) not /dev/hd(x). The (a) is for the first hard drive, the second would be (b) and so on. Grub uses numbers rather than letters to identify the disk order, and grub starts counting from (0), not (1).
I was hoping the menu.lst would show which kernel you were running as I mistakenly assumed it was your Fedora Core 3 distribution in your profile you had installed. But apparently the menu.lst is from Arch which does not specify the kernel version, as this is where I was hoping to see if you should be using /dev/sda rather than /dev/hda.
Apparently your Arch Linux has implemented the change, which now limits you to 15 partitions like an SCSI SATA drive rather than the normal 63 partitions for a PATA disk.

IDE (Integrated Drive Electronics), is actually the name of a consortium whose goal was to integrate the ATA interface into various electronic drives like tape drives, optical drives etc. The interface is ATA and when hard drive manufacturers added a second head to ATA hard drives bringing the total to two heads (one for reading, one for writing), now hard drives could read and write at the same time compared to only one or the other when drives only had one head. This is where data now ran up and down the ATA cable at the same time when the drive performed reads and writes at the same time in parallel (8 bits each way), and the name of the hard drive changed from ATA to PATA (Parallel ATA).
 
Old 10-15-2007, 03:07 AM   #7
hramat
LQ Newbie
 
Registered: Feb 2005
Location: The Netherland
Distribution: Fedora core 3, Arch Linux
Posts: 9

Original Poster
Rep: Reputation: 0
thanx guys for help.

I have done my data migration with help of partimage on SystemRescueCd (live linux distro). It was the SystemRescueCd which mixed up those HDD. That's why I changed sda to hda. On my laptop I am using arch linux and that one seems to work with sda. I am using FC3 at work so I still keep it in my profile. Again thanx
 
  


Reply



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
My New Harddisk mrtcn Linux - Hardware 9 03-05-2007 11:16 AM
copying files in RH9 from 1 harddisk to another in same system(internal) rajivb Linux - Newbie 8 03-09-2005 10:24 AM
Low Harddisk space. Can I just transfer the entire Linux to a bigger harddisk? davidas Linux - Newbie 12 04-13-2004 02:03 AM
WD-Harddisk Config Linux - Software 2 02-19-2002 07:40 AM
Harddisk. chuck77 Linux - General 3 12-13-2001 05:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:43 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