Hi all,
I am trying to boot from a HD created as a copy of a running system (and it doesn't work, and I don't understand why ...)
This is the system to be copied : File-system Size Used Avail Use% Mounted on /dev/hda1 2.0G 797M 1.1G 43% / tmpfs 506M 0 506M 0% /dev/shm /dev/hda5 4.7G 3.3G 1.2G 74% /var/spool/squid/cache1 /dev/hda6 4.7G 3.3G 1.2G 74% /var/spool/squid/cache2
The backup of the system has been done with : /bin/tar czO -C / --preserve-permissions --sparse --one-file-system \ --exclude=lost+found --exclude=tmp/* \ . \ | /usr/bin/nc -w 5 my.workstation 6060 # ( after executing # netcat -l -p 6060 > $IMAGE on my.workstation )
On the target HD, I have created three "type 83" partitions and a swap, ran mke2fs -cc -j /dev/$D for the three FS and mkswap -c /dev/$D for the future swap.
The target root FS was restored with : tar xzpf $IMAGE -C /mnt/linux
On the target root FS, I edited /etc/fstab and /etc/grub.conf, replacing any reference to LABEL=... by the real device (/dev/hda1 and so on).
Then I took care of the initrd (future / is mounted on /mnt/linux/) : mount -o bind /dev /mnt/linux/dev mount -t proc none /mnt/linux/proc mount -t sysfs none /mnt/linux/sys rm /mnt/linux/boot/initrd* chroot /mnt/linux mkinitrd /boot/initrd-2.6.18-194.3.1.el5.img 2.6.18-194.3.1.el5 # so far, so good...
... and installed grub on the target HD : /sbin/grub --no-curses find /boot/grub/stage1 # answer : (hd0,0) root (hd0,0) setup (hd0) # answer : succeeded quit exit # (chroot)
When I try to boot the target HD (set as hda in a new PC), I get the grub prompt, and I can boot the system. Every thing goes too quickly, so I can't see what is going on, until :
... Trying to resume from /dev/hda3 No suspend signature on swap, not resuming. Creating root device. Mounting root filesystem. mount: error mounting /dev/root on /sysroot as auto: No such device Setting up other filesystems. Setting up new root fs setuproot: moving /dev/failed: No such file or directory no fstab.sys, mounting internal defaults Then it complains about missing /proc and /sys, and end with : switchroot: mount failed: No such file or directory Kernel panic - not syncing: Attempted to kill init!
/dev/hda3 is the swap partition on the new disk. The swap was in /dev/hda2 on the old disk, but fstab has been modified accordingly ; other FS are just like on the old disk (I mean, / is hda1, cache1 is hda5 and cache2 is hda6).
I have certainly forgotten something, but I am unable to find what... Who can help me ?
Thanks,
On 06/08/2010 01:26 PM, Philippe Naudin wrote: ...
mount: error mounting /dev/root on /sysroot as auto: No such device
...
I have certainly forgotten something, but I am unable to find what...
What is the exact contents of your /etc/fstab file?
Mogens
Le Tue, 08 Jun 2010 13:42:44 +0200, Mogens Kjaer mk@lemo.dk a écrit :
On 06/08/2010 01:26 PM, Philippe Naudin wrote: ...
mount: error mounting /dev/root on /sysroot as auto: No such device
...
I have certainly forgotten something, but I am unable to find what...
What is the exact contents of your /etc/fstab file?
Mogens
Please excuse the long lines below :
# cat /mnt/linux/etc/fstab /dev/hda1 / ext3 defaults 1 1 tmpfs /dev/shm tmpfs defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 /dev/hda3 swap swap defaults 0 0 /dev/hda5 /var/spool/squid/cache1 ext3 defaults,noatime,nodev,noexec 1 2 /dev/hda6 /var/spool/squid/cache2 ext3 defaults,noatime,nodev,noexec 1 2 /dev/hdc /mnt/cdrom auto noauto,owner,user,ro 0 0
... and the partition table is : # fdisk -l Disk /dev/hda: 81.9 GB, 81964302336 bytes 16 heads, 63 sectors/track, 158816 cylinders Units = cylinders of 1008 * 512 = 516096 bytes Disk identifier: 0x44018339
Device Boot Start End Blocks Id System /dev/hda1 1 3969 2000344+ 83 Linux /dev/hda2 3970 7938 2000376 83 Linux /dev/hda3 7939 11907 2000376 82 Linux swap / Solaris /dev/hda4 11908 158816 74042136 5 Extended /dev/hda5 11908 31749 10000336+ 83 Linux /dev/hda6 31750 51591 10000336+ 83 Linux
Any idea ?
Cheers,
On 06/08/2010 02:13 PM, Philippe Naudin wrote: ...
mount: error mounting /dev/root on /sysroot as auto: No such device
...
Any idea ?
/etc/fstab looks good; now what's in your /boot/grub/grub.conf file?
BTW, if you boot in rescue mode from the installation DVD/CD, does it automatically mount everything?
Mogens
Le Tue, 08 Jun 2010 14:30:40 +0200, Mogens Kjaer mk@lemo.dk a écrit :
On 06/08/2010 02:13 PM, Philippe Naudin wrote: ...
mount: error mounting /dev/root on /sysroot as auto: No such device
...
Any idea ?
/etc/fstab looks good; now what's in your /boot/grub/grub.conf file?
# cat /mnt/linux/etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You do not have a /boot partition. This means that # all kernel and initrd paths are relative to /, eg. # root (hd0,0) # kernel /boot/vmlinuz-version ro root=/dev/hda1 # initrd /boot/initrd-version.img #boot=/dev/hda default=0 timeout=5 splashimage=(hd0,0)/boot/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-194.3.1.el5) root (hd0,0) kernel /boot/vmlinuz-2.6.18-194.3.1.el5 ro root=/dev/hda1 initrd /boot/initrd-2.6.18-194.3.1.el5.img
BTW, if you boot in rescue mode from the installation DVD/CD, does it automatically mount everything?
Yes, including swap, and dmesg doesn't report any errors. I chrooted to /mnt/sysimage and tried grub-install /dev/hda1 : Installation finished. No error reported. (hd0) /dev/hda ... but no better result after a reboot (exactly the same messages).
My bet is : grub is ok, initrd maybe, but something else is missing (udev ? selinux is disabled).
Cheers,
On Tue, 2010-06-08 at 15:02 +0200, Philippe Naudin wrote:
Le Tue, 08 Jun 2010 14:30:40 +0200, Mogens Kjaer mk@lemo.dk a écrit :
On 06/08/2010 02:13 PM, Philippe Naudin wrote: ...
mount: error mounting /dev/root on /sysroot as auto: No such device
...
Any idea ?
/etc/fstab looks good; now what's in your /boot/grub/grub.conf file?
# cat /mnt/linux/etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You do not have a /boot partition. This means that # all kernel and initrd paths are relative to /, eg. # root (hd0,0) # kernel /boot/vmlinuz-version ro root=/dev/hda1 # initrd /boot/initrd-version.img #boot=/dev/hda default=0 timeout=5 splashimage=(hd0,0)/boot/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-194.3.1.el5) root (hd0,0) kernel /boot/vmlinuz-2.6.18-194.3.1.el5 ro root=/dev/hda1 initrd /boot/initrd-2.6.18-194.3.1.el5.img
BTW, if you boot in rescue mode from the installation DVD/CD, does it automatically mount everything?
Yes, including swap, and dmesg doesn't report any errors. I chrooted to /mnt/sysimage and tried grub-install /dev/hda1 : Installation finished. No error reported. (hd0) /dev/hda ... but no better result after a reboot (exactly the same messages).
----- after boot with rescue disk and chroot to /mnt/sysimage
the correct command is
grub-install /dev/hda # not /dev/hda1
Craig
On Jun 8, 2010, at 9:02 AM, Philippe Naudin <philippe.naudin@supagro.inra.fr
wrote:
Le Tue, 08 Jun 2010 14:30:40 +0200, Mogens Kjaer mk@lemo.dk a écrit :
On 06/08/2010 02:13 PM, Philippe Naudin wrote: ...
mount: error mounting /dev/root on /sysroot as auto: No such device
...
Any idea ?
/etc/fstab looks good; now what's in your /boot/grub/grub.conf file?
# cat /mnt/linux/etc/grub.conf # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You do not have a /boot partition. This means that # all kernel and initrd paths are relative to /, eg. # root (hd0,0) # kernel /boot/vmlinuz-version ro root=/dev/hda1 # initrd /boot/initrd-version.img #boot=/dev/hda default=0 timeout=5 splashimage=(hd0,0)/boot/grub/splash.xpm.gz hiddenmenu title CentOS (2.6.18-194.3.1.el5) root (hd0,0) kernel /boot/vmlinuz-2.6.18-194.3.1.el5 ro root=/dev/hda1 initrd /boot/initrd-2.6.18-194.3.1.el5.img
BTW, if you boot in rescue mode from the installation DVD/CD, does it automatically mount everything?
Yes, including swap, and dmesg doesn't report any errors. I chrooted to /mnt/sysimage and tried grub-install /dev/hda1 : Installation finished. No error reported. (hd0) /dev/hda ... but no better result after a reboot (exactly the same messages).
My bet is : grub is ok, initrd maybe, but something else is missing (udev ? selinux is disabled).
What does modprobe.conf look like?
-Ross
I think Craig might have nailed it... but also what is your devices.map as well?
Sent from Android mobile
On Jun 8, 2010 2:17 PM, "Ross Walker" rswwalker@gmail.com wrote:
On Jun 8, 2010, at 9:02 AM, Philippe Naudin <philippe.naudin@supagro.inra.fr
wrote:
Le Tue, 08 Jun 2010 14:30:40 +0200, Mogens Kjaer mk@lemo.dk a écrit :
On 06/08...
What does modprobe.conf look like?
-Ross
_______________________________________________ CentOS mailing list CentOS@centos.org http://lists....
OK, I still don't understand what exactly went wrong, but my system boot nicely now. I think the problem was here :
Trying to resume from /dev/hda3 No suspend signature on swap, not resuming. Creating root device. Mounting root filesystem. mount: error mounting /dev/root on /sysroot as auto: No such device
^^^^ This is because, when I ran mkinitrd, /etc/fstab was reading: /dev/hda1 / auto defaults 1 1 instead of : /dev/hda1 / ext3 defaults 1 1
I am not really sure this was the problem, and can only suppose that the support for ext3 was missing in the initrd.img (ext3 as a module, they are crazy ;-), but I re-ran mkinitrd after editing fstab and voila.
Thanks to all of you for your answers !