You are not logged in.

#1 2010-03-31 12:43:24

mos98
Member
Registered: 2010-02-07
Posts: 24

[solved] copy to new hard drive: no /sbin/init found

I got myself a new hard drive so I copied my old system to the new drive.

The partition layout of the new drive looks similar to the old one (only this time /boot is somewhat smaller than it used to be)

WINDOWS                           /dev/sdb1
SWAP                                /dev/sdb2
BOOT               (/boot)       /dev/sdb3
EXTENDED                         /dev/sdb4
ROOT                (/)             /dev/sdb5
HOME               (/home)     /dev/sdb6

To copy /, /boot and /home to the new drive I used the following command

mount /dev/sdb3 /mnt/sdb3; cd /boot; find . -xdev -print0 | cpio -pdvum0 --sparse /mnt/sdb3

I did the same thing for the other two partitions /dev/sdb5 and /dev/sdb6 (where /dev/sdb stands for the new drive)

After that I re-installed Grub via the live cd. Everything went like a charm until  I tried to  boot from
the new drive. This is the error message I see:

Error: Root device mounted successfully, but /sbin/init does not exists.
Bailing out, you are on your own. Good Luck

I checked /sbin/init and it's definitely there
I thought maybe one should better use dd instead of cpio to copy the ROOT Partition from /dev/sda5 to /dev/sdb5

So next thing I did was using dd instead of cpio like that

dd if=/dev/sda5 of=/dev/sdb5 bs=32768   conv=noerror,sync

with unmounted hardrives in live cd mode.


But the error still remains. I guess  the error  must be caused somewhere else. But how?

Is there a better way to copy an existing installation to a new hard drive?
Does anyone have some insight?

Last edited by mos98 (2010-04-03 11:56:22)

Offline

#2 2010-03-31 13:25:11

stryder
Member
Registered: 2009-02-28
Posts: 500

Re: [solved] copy to new hard drive: no /sbin/init found

Did you try to boot using the fallback option?

Offline

#3 2010-03-31 13:38:22

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: [solved] copy to new hard drive: no /sbin/init found

Chroot into your system with a live cd and rebuild initrd (reinstall kernel26)

Offline

#4 2010-03-31 16:55:25

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: [solved] copy to new hard drive: no /sbin/init found

@stryder I did same result  though

Now I followed pretty much word by word this article
and reinstalled the kernel.
http://wiki.archlinux.org/index.php/Kernel_Panics

I had to download the current kernel manually since I cleaned up my pacman repo yesterday.

But even after rebuilding the kernel I still get the same error

EXT4-fs (sda3): INFO: recovery required on readonly filesystem
EXT4-fs (sda3): write access will be enabled during recovery
EXT4-fs (sda3): recovery complete
EXT4-fs (sda3): mounted filesystem with ordered data mode
Error: Root device mounted successfully, but /sbin/init does not exists.
Bailing out, you are on your own. Good Luck

/bin/sh: can't access  tty; job control turned off
[ramfs /]#

EDIT: after the forth time I went through the whole process I started to manually umount /dev/sda3, /dev/proc , /dev/sys etc. before rebooting now the EXT4 INFO warnings have disappeared but of course the boot problem itself still remains .

There's a small problem with the wiki text.

If you follow the text closely and I assume you have a separate  boot partition on for instance /dev/sda3 like I do, then mounting /dev/sda3 the one containing the boot partition after /dev/sda5 (the root partition) will lead to the following error as soon you chroot and call pacman

/boot appears to be a seperate partition but is not mounted. 
This most likely not what you want. Please mount your /boot partition and reinstall the Kernel unless
you are sure this is OK

What worked for me though after rebooting and starting the whole process again was mounting the boot partition i.e. /dev/sda3 *after* I chroot.

1) mount the root partition
2) do the proc sys and dev stuff as described in the wiki article
3) chroot
4) then finally mount the partition containing boot
5) start pacman -U ./kernel...

For some reason the boot partition doesn't show up in the chroot environment even if it is  actually mounted.

Last edited by mos98 (2010-03-31 20:28:10)

Offline

#5 2010-03-31 17:34:07

Slurp53
Member
Registered: 2010-03-31
Posts: 20

Re: [solved] copy to new hard drive: no /sbin/init found

Try Clonezilla

http://clonezilla.org/

I believe you can put both hard drives in the computer and clone from one to the other.  I've used it several times and it works great.  I usually have an ssh server to hold the drive image, but if you don't have an extra computer it think you can go drive to drive.

Offline

#6 2010-03-31 18:44:03

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: [solved] copy to new hard drive: no /sbin/init found

Slurp53 wrote:

Try Clonezilla

http://clonezilla.org/

I believe you can put both hard drives in the computer and clone from one to the other.  I've used it several times and it works great.  I usually have an ssh server to hold the drive image, but if you don't have an extra computer it think you can go drive to drive.

But clonezilla is nowhere in the arch repo whether in extra nor in AUR is it?

Last edited by mos98 (2010-03-31 18:54:53)

Offline

#7 2010-03-31 19:03:44

Slurp53
Member
Registered: 2010-03-31
Posts: 20

Re: [solved] copy to new hard drive: no /sbin/init found

Clonezilla is a live CD disto.  It allows you to clone drives or partitions from one device to another very easly. 

Is there a better way to copy an existing installation to a new hard drive?

This is it, it does exactly what you want to do effortlessly.

smile:)

Offline

#8 2010-03-31 19:31:31

Ultraman
Member
Registered: 2009-12-24
Posts: 242

Re: [solved] copy to new hard drive: no /sbin/init found

I used rsync to do this once. Cloning was not an option in my case as I was moving from single disk to raid1 with different sizes for my partitions (well... logical volumes wink ).
This helped me out at that time: http://wiki.archlinux.org/index.php/Ful … with_rsync, together with some stuff I found on the web.
But if you are simply moving from drive to drive and use regular partitions, clonezilla is a good option. You can use (G)Parted (LiveCD or the package, w/e you prefer), to resize partitions to fill the possible extra space the new harddrive might offer. smile

Offline

#9 2010-03-31 19:46:49

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: [solved] copy to new hard drive: no /sbin/init found

hmm  alright  smile

slurp53 I did what you suggested burnt the ISO (took the ubuntu option) and booted the clonezilla live cd

I chose my source and my dest partitions. so far so good

But (I hate those buts no pun)  very shortly after clonezilla starts cloning --->  extfsclone.c FS has been mounted 3218000456 times without being checked

lol 3 billion times good guess I'd say no?

So the situation is no worse then before since I can't even boot with grub any more. The fisrt thing grub says now is

GRUB loading, please wait...
Error 17

Before I could at least reach the grub menu and start windows ( not that this has been anything to do with the problem... )

Last edited by mos98 (2010-03-31 19:53:00)

Offline

#10 2010-03-31 20:45:21

Slurp53
Member
Registered: 2010-03-31
Posts: 20

Re: [solved] copy to new hard drive: no /sbin/init found

Are you sure you don't have some sort of hard drive/filesystem corruption going on here?  Have you run a check disk on the partition?  Not sure if you can do that from Clonzilla.  I know you can use Knoppix for that sort of thing.  Not supposed to do it on a mounted partition.

fsck.ext2 /dev/(partition name)

If it's an ext2 file system.  Similar flavors exist for other file system types.  Make sure you understand what fsck does before you use it.

Filesystem/hard drive corruption might expain the cause of the inital problem.

Offline

#11 2010-04-01 07:04:06

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Re: [solved] copy to new hard drive: no /sbin/init found

mount /dev/sdb3 /mnt/sdb3; cd /boot; find . -xdev -print0 | cpio -pdvum0 --sparse /mnt/sdb3

What?  This seems extraordinarily complex.  Why do this instead of 'cp -a'?


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#12 2010-04-01 08:50:11

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: [solved] copy to new hard drive: no /sbin/init found

Slurp53 wrote:

Are you sure you don't have some sort of hard drive/filesystem corruption going on here?  Have you run a check disk on the partition?  Not sure if you can do that from Clonzilla.  I know you can use Knoppix for that sort of thing.  Not supposed to do it on a mounted partition.

fsck.ext2 /dev/(partition name)

If it's an ext2 file system.  Similar flavors exist for other file system types.  Make sure you understand what fsck does before you use it.

Filesystem/hard drive corruption might expain the cause of the inital problem.

Yes you can run fsck in clonezilla since it's based on ubuntu

I contacted THomas Tsai he is one of the partclone/clonezilla project members and he told me that I must check the source partition (the error msg didn't state clearly which FS should be checked, so I needed clarification) (the given number of course is wrong, this should be fixed for the next release as he said). Thanks Thomas for the prompt response!

Now after that I became aware that my old disk actually isn't checked. For some reason it says

check deferred, on battery

at boot time. But obviously  I'm running a desktop pc not a notebook!!

This is probably also the reason why this weird error message popped up in clonezilla. So I still assume that my new hard drive has no defects

Anyway I checked /dev/sda3   (the one which caused the problem)

fsck.ext2 -fp /dev/sda3

all went fine, no errors. Started clonezilla again. This time I chose to clone the whole disk at once. After 30 min or so
clonezilla finished its work without any problems or errors

Then I changed the old UUIDs of my old drive in grub/menu.lst to /dev/sda3, disconnected the old drive and made the new drive the MASTER drive.

REBOOT

BAADANNNG!   Grub ist running, I can even boot into Windows 7 !! It detects my new drive configures it,  very nicely!


But with Archie still no luck!! I still get the same old error msg about the missing /sbin/init  sad((((

Last edited by mos98 (2010-04-01 09:15:49)

Offline

#13 2010-04-01 09:06:00

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: [solved] copy to new hard drive: no /sbin/init found

Gen2ly wrote:
mount /dev/sdb3 /mnt/sdb3; cd /boot; find . -xdev -print0 | cpio -pdvum0 --sparse /mnt/sdb3

What?  This seems extraordinarily complex.  Why do this instead of 'cp -a'?

This was only my first attempt but your right later I tried this approach  (kudos to jean-paul @ https://forum.archlinux.de/?id=20;page= … 86;post=-1 for this part.)


+ connect both drives to the pc. Source drive as /dev/sda
+ New drive as  sdb 
+ Boot the system 
+ fdisk /dev/sdb
+ partition the new drve aka /dev/sdb
+ write the partition table to /dev/sdb
+ mkfs.ext2 /dev/sdb3  (/boot)
+ mkfs.ext4 /dev/sdb5  ( / )
+ mkfs.ext4 /dev/sdb6  ( /home )

+ mkswap /dev/sdb2
+ boot live-cd
+ mkdir /mnt/{sda1,sda3,sda6,sdb1,sdb3,sdb6}
+ mount -r /dev/sda3 /mnt/sda3  
+ mount /dev/sdb3 /mnt/sdb3
+ cp -a /mnt/sda3/* /mnt/sdb3  (copying the boot partition)
+ umount /mnt/sda3
+ umount /mnt/sdb3
+ same for /dev/sda5 and /dev/sda6
+ poweroff the system
+ disconnect the old drive, make new drive the MASTER drive
+ boot ilive-cd
+ install grub***
+ restart system

But with no avail I still got the same error



***In order to install grub I had to

mount /dev/sda5 /mnt

mount -t proc none /mnt/proc
mount -t sysfs none /mnt/sys
mount --bind /dev /mnt/dev

chroot /mnt

mount /dev/sda3 /boot

grub-install /dev/sda

grub-install --recheck /dev/sda

neither


grub-install /dev/sda

nor

mkdir /mnt/boot

mount /dev/sda3 /mnt/boot

grub-install --root-directory=/mnt /dev/sda

worked for me.

In the first case grub couldn't find /boot. In the latter grub wouldn't present  the normal grub boot menu after rebooting instead I only got the naked grub shell. I dunno why.

Last edited by mos98 (2010-04-01 09:11:50)

Offline

#14 2010-04-01 12:35:56

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: [solved] copy to new hard drive: no /sbin/init found

Just in order to check if the hard drive is ok I did a quick base installation of arch using the same drive partitioning as before and guess what now I can boot the system!. But this is not what i want. So after this positive experience I went back to clonezilla and copied /dev/sda5 i.e. the partition that contains the ROOT directory which is on my old drive to /dev/sdb5 to my new drive overwriting the base system that I have installed previously. Now I get the old error message back again.

So therefore I deduce something must be wrong about the ROOT partition on my old drive (i.e. /dev/sda5) (sorry but it's hard to believe that cloning a windows partition is much much simpler than cloning linux. I simply don't get it. Isn't it supposed to be the other way round ? )

Last edited by mos98 (2010-04-01 12:40:07)

Offline

#15 2010-04-03 12:03:46

mos98
Member
Registered: 2010-02-07
Posts: 24

Re: [solved] copy to new hard drive: no /sbin/init found

Here is the trivial solution: my /boot/grub/menu.lst was wrong, Instead by /dev/sda5 I replaced the old UUIDs of the old partition wrongly by /dev/sda3. My fault.  Should have known that /dev/sda3 doesn't contain the ROOT  partition, but  /dev/sda5 does.
UUIDs are good for machines but not so good to humans.

# (0) Arch Linux
title  Arch Linux
root   (hd0,2)
kernel /vmlinuz26 root=/dev/sda5 ro acpi=ht apm=power_off
initrd /kernel26.img
# verbose

Last edited by mos98 (2010-04-03 12:04:26)

Offline

Board footer

Powered by FluxBB