LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-03-2012, 02:38 PM   #1
completelinuxnube
LQ Newbie
 
Registered: Jul 2012
Distribution: Slackware
Posts: 22

Rep: Reputation: 0
Cannot boot cloned hdd in place of the original internal hdd


Hello Friends,

I recently cloned my internal hdd to an external hdd via a usb bridge. I have tried replacing the original internal hdd with the clone to see if it would boot, but it does not. I also tried booting it from the usb bridge and I end up with the same result.

I get the following error message at bootup:

kmod: failed to exec /sbin/modprobe -s -k block-major-22, errno = 2
VFS: Cannot open root device "1603" or 16:03
Please append a correct "root" boot option
Kernel panic: VFS: Unable to mount root fs on 16:03

I will list my system details and all the commands that I used in the process of cloning the drive below, also the steps I have tried to solve the problem.

System details:
Lenovo Thinkcentre w/:
2GB RAM
500GB Internal Sata HDD
Installed OS: Slackware Linux 13.37 w/ kernel 2.6.37.6-smp
Processor: Intel Pentium Dual Core E2180 / 2 GHz
80GB External HDD connected via usb bridge


Process used to clone the drive:

1) connected usb drive via usb dock (bridge)
2) ran fdisk -l
3) made note of the partitions listed
4) ran cfdisk on usb device shown as /dev/sdb
5) created the following partitions and wrote to hdd:
/dev/sdb1 Linux Swap 1GB
/dev/sdb2 Linux 1GB [Flagged as bootable]
/dev/sdb3 Linux 78GB [Remainder of 80GB HDD]
6) Rebooted after successful partition write
7) ran fdisk -l to verfiy new partitions
8) ran
Code:
mkfs -t reiserfs /dev/sdb1
and did the same for the other 2 partitions
9) mounted / filesystem of internal hdd to /mnt/source using:
Code:
mount -B / /mnt/source
10) mounted /dev/sdb3 to /mnt/destination using:
Code:
mount -t reiserfs /dev/sdb3 /mnt/destination
12) ran cp command as follows:
Code:
cp -av /mnt/source/* /mnt/destination
(successfully copied all files)
13) ran df -H to compare sizes and used ls -la to compare files
14) ran umount to remove the mounts
15) mounted /dev/sdb2 to /mnt/destination2 the same as before
16) mounted /dev/sda2 to /mnt/source using same method as before
17) ran cp command and all other steps as before (files and directories were successfully copied)
18) Did not copy swap partition [I was under the impression that the system would handle the swap files]

Steps taken as an attempt to resolve the problem
:
1) Booted from the Slackware Linux 13.37 Install CD
2) booted into /dev/sda3 [ / filesystem ] (Cloned drive became /dev/sda when placed in the system)
3) attempted to append root boot option (however it was already present & correct)
4) attempted to create a new initrd
5) edited the /etc/lilo.conf and tried to run /sbin/lilo (permission was denied even as root user)
6) attempted to run liloconfig at prompt (got no response)

Now I am stuck with the error above and do not know what to do next. Can anyone help me please? Thanks in advance. I apologize for such a long post, but I wanted to give as much detail as possible. Thanks again.
 
Old 08-03-2012, 02:47 PM   #2
clod89
Member
 
Registered: Jun 2012
Distribution: Slackware gentoo debian
Posts: 41

Rep: Reputation: Disabled
I'm not sure that is the correct procedure to clone an hard drive, i'd simply do a dd if=/dev/sda of=/dev/sdbX, and then eventually resize the partitions with gparted.
 
1 members found this post helpful.
Old 08-03-2012, 03:16 PM   #3
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 53
I'm not a lilo user, but I think your problem is that you haven't installed it (or any other boot loader) to the MBR of the new HD.
This link should help.
The other way would be to put your old HD back as /dev/sda and then dd just the first 512 bytes of it to the new HD
The command for this is (assuming the new HD is /sdb; change if necessary)
Code:
dd if=/dev/sda of=/dev/sdb bs=512 count=1
check the dd man page (I might have blundered) and your /etc/lilo.conf file
 
1 members found this post helpful.
Old 08-03-2012, 03:52 PM   #4
completelinuxnube
LQ Newbie
 
Registered: Jul 2012
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 0
@clod89, thanks for the info. I have tried this once, but I will give it another go.

Last edited by completelinuxnube; 08-03-2012 at 03:55 PM. Reason: corrected punctuation
 
Old 08-03-2012, 03:54 PM   #5
completelinuxnube
LQ Newbie
 
Registered: Jul 2012
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 0
@impert, that sounds logical to me. Thanks for the suggestion. I will try it out.
 
Old 08-03-2012, 04:32 PM   #6
completelinuxnube
LQ Newbie
 
Registered: Jul 2012
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 0
@impert, I attempted the dd command as you specified, but I ended up getting this error message at boot up: Missing operating system
I will keep trying, perhaps something went wrong.
 
Old 08-03-2012, 05:50 PM   #7
mrascii
Member
 
Registered: Jun 2012
Location: on the Net
Distribution: Slackware
Posts: 100

Rep: Reputation: Disabled
I'd go with clod89's suggestion. Even with a bootloader installed /etc/lilo.conf and /etcfstab will need to be edited so they point to the correct partitions. Using ddrescue (System Rescue CD) may work much faster than just dd.

DNA
AKA mrascii
 
1 members found this post helpful.
Old 08-03-2012, 11:57 PM   #8
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 797

Rep: Reputation: 247Reputation: 247Reputation: 247
Here are a few things to keep in mind when copying an operating system to a new hard disk.

The new hard disk may use a different geometry (number of heads and sectors). In that case you may have to reinstall the boot loader even when copying whole partitions with "dd". You can avoid this problem by configuring the BIOS to use LBA for accessing disks, and configuring your boot loader to use LBA (before copying the disk).

Unless you copy the first sector of the hard disk, you may have to install the default MBR software. To solve this problem, install the boot loader to the MBR after copying, or use a program to restore the default MBR software. When you create the first partition on a completely empty hard disk, the "fdisk" or "cfdisk" program will install the default MBR software. To force that to happen you can zero the first hard disk sector before creating partitions. Zeroing the first hard disk sector will make any existing partitions or data inaccessible!

When using the default MBR software you must set a primary partition's "boot" flag and install a boot loader to the primary partition's boot sector.

If the disk drive will be attached to a different disk controller, the Linux device name may change. You might have to change the boot options and "fstab" to specify the correct device name.

If you change the order of partitions on the hard disk you also may have to change the boot options and "fstab".

If you change the BIOS default boot disk, or the order in which disks are booted, the BIOS drive ID assignments may change. You may have to reinstall the boot loader to solve that problem.

When you install (or update) the LILO configuration it stores a list of the sector addresses for the kernel and initrd files. When you copy files with "cp" they often use different sectors of the destination disk. LILO must be reinstalled to properly access the files.

To avoid possible confusion when testing it is best to disconnect the original drive when booting the copy. Otherwise, you might not realize when some files are being read from the original disk instead of the copy.
 
1 members found this post helpful.
Old 08-04-2012, 12:04 AM   #9
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 797

Rep: Reputation: 247Reputation: 247Reputation: 247
If you are having problems with creating files on the root file-system, make sure that it is mounted for read and write. The root file-system is mounted read-only during the boot process, and is later re-mounted with write access. When you have problems with the "initrd" or initialization scripts, the process may abort before the root file-system is mounted with write access.
 
1 members found this post helpful.
Old 08-04-2012, 01:21 AM   #10
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,177

Rep: Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018
You can look at this how-to I wrote a few months ago, though it be not exactly what you want (if you follow it as it is you will have to copy your user files and programs not included in Slackware afterwards).

Last edited by Didier Spaier; 08-04-2012 at 01:25 AM.
 
1 members found this post helpful.
Old 08-04-2012, 04:56 AM   #11
impert
Member
 
Registered: Feb 2009
Posts: 282

Rep: Reputation: 53
Quote:
Even with a bootloader installed /etc/lilo.conf and /etc/fstab will need to be edited so they point to the correct partitions.
This is very likely the problem.
If you use UUIDs in either, make sure that you haven't just copied the UUID's that correspond to the old HD partitions.
The line specifying the kernel should have either root=/dev/sdX where X stands for the correct number, or root= followed by the correct UUID. And I would put in ro just to be sure.
 
1 members found this post helpful.
Old 08-04-2012, 05:39 AM   #12
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,177

Rep: Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018
Also, I suggest you append the "rootdelay=30" parameter in the relevant image section of /etc/lilo.conf as an external usb drive needs a few seconds to synchronize, before the partitions become available. See aforementioned link for explanation.
 
2 members found this post helpful.
Old 08-06-2012, 02:24 PM   #13
completelinuxnube
LQ Newbie
 
Registered: Jul 2012
Distribution: Slackware
Posts: 22

Original Poster
Rep: Reputation: 0
Thanks for all the info my friends.
 
  


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
Slow USB transfer rates (60kb p/s) External HDD --> Internal HDD drfrostbyte Linux - Hardware 4 03-28-2011 01:20 AM
corrupted HDD: need to place backup onto different HDD Cyberman Linux - Desktop 6 09-26-2009 10:51 PM
I installed ubuntu 9.04 to my Maxtor external hdd. I have no internal hdd. I can boot dont33 Linux - Newbie 1 08-13-2009 04:13 PM
cat cloned hdd on different hdd models jasontn Linux - Hardware 12 04-24-2006 06:08 PM
Dual boot XP(internal IDE HDD) Debian(external USB-IDE HDD) using boot.ini PolarDog Linux - Laptop and Netbook 2 07-01-2005 09:50 PM


All times are GMT -5. The time now is 12:07 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration