public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] plain copy of root disk won't work
@ 2016-11-18 15:30 Raffaele BELARDI
  2016-11-18 17:57 ` Canek Peláez Valdés
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Raffaele BELARDI @ 2016-11-18 15:30 UTC (permalink / raw
  To: gentoo-user@lists.gentoo.org

I want to move the main disk contents (hda, PATA) to another, larger 
disk (sda, SATA).

hda contains 4 ext3 partitions (root, home, data, swap).
I created 4 ext3 partitions on sda and copied the data over from the 
corresponding hda partitions using 'cp -ax'.
Then I chroot into sda1, 'grub-install /dev/sda', grub-mkconfig and edit 
fstab to use sda instead of hda.
Reboot, from the non-UEFI bios change the disk boot order and try to 
boot from sda.
grub from the sda starts, loads the kernel from sda1, the kernel finds 
the root file system and mounts it RO but then the process stops at the 
end of the kernel boot. No kernel panic, just hangs there with the last 
kernel message before openrc. Openrc is not started.

What might I be missing?

thanks,

raffaele

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] plain copy of root disk won't work
  2016-11-18 15:30 [gentoo-user] plain copy of root disk won't work Raffaele BELARDI
@ 2016-11-18 17:57 ` Canek Peláez Valdés
  2016-11-18 19:20 ` Константин
  2016-11-18 23:31 ` [gentoo-user] plain copy of root disk won't work Fernando Rodriguez
  2 siblings, 0 replies; 6+ messages in thread
From: Canek Peláez Valdés @ 2016-11-18 17:57 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

On Fri, Nov 18, 2016 at 9:30 AM, Raffaele BELARDI <raffaele.belardi@st.com>
wrote:
>
> I want to move the main disk contents (hda, PATA) to another, larger
> disk (sda, SATA).
>
> hda contains 4 ext3 partitions (root, home, data, swap).
> I created 4 ext3 partitions on sda and copied the data over from the
> corresponding hda partitions using 'cp -ax'.
> Then I chroot into sda1, 'grub-install /dev/sda', grub-mkconfig and edit
> fstab to use sda instead of hda.
> Reboot, from the non-UEFI bios change the disk boot order and try to
> boot from sda.
> grub from the sda starts, loads the kernel from sda1, the kernel finds
> the root file system and mounts it RO but then the process stops at the
> end of the kernel boot. No kernel panic, just hangs there with the last
> kernel message before openrc. Openrc is not started.
>
> What might I be missing?

Perhaps some permissions and special files. I would use rsync for such a
task:

rsync -Pvas /source/directory/ /target/directory/

I've used that commend in the past for exactly the same motives as you. It
works; also, it's faster I think.

Regards.
--
Dr. Canek Peláez Valdés
Profesor de Carrera Asociado C
Departamento de Matemáticas
Facultad de Ciencias
Universidad Nacional Autónoma de México

[-- Attachment #2: Type: text/html, Size: 1540 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] plain copy of root disk won't work
  2016-11-18 15:30 [gentoo-user] plain copy of root disk won't work Raffaele BELARDI
  2016-11-18 17:57 ` Canek Peláez Valdés
@ 2016-11-18 19:20 ` Константин
  2016-11-19 16:07   ` Frank Steinmetzger
  2016-11-21  6:19   ` [gentoo-user] plain copy of root disk won't work - SOLVED Raffaele BELARDI
  2016-11-18 23:31 ` [gentoo-user] plain copy of root disk won't work Fernando Rodriguez
  2 siblings, 2 replies; 6+ messages in thread
From: Константин @ 2016-11-18 19:20 UTC (permalink / raw
  To: gentoo-user

On Fri, Nov 18, 2016 at 04:30:28PM +0100, Raffaele BELARDI wrote:
> I want to move the main disk contents (hda, PATA) to another, larger
> disk (sda, SATA).
>
> hda contains 4 ext3 partitions (root, home, data, swap).
> I created 4 ext3 partitions on sda and copied the data over from the
> corresponding hda partitions using 'cp -ax'.

Didn't you do this from working system on hda? In this case there
really could be troubles with special files etc. Imho live-cd better
for this purpose.

At any case imho it's better to split this task

0. Boot from live-cd.
1. Copy partitions from hda to sda (cp or rsync)
2. Edit fstab on sda.
3. Configure grub on HDA to see hda and sda systems,
4. Try to boot sda.
5. If all is good, configure grub on sda, and change BIOS boot order.

As Canek wrote rsync is great for this task, but beware - last '/' in
'/source/directory/' means!

#kstn


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] plain copy of root disk won't work
  2016-11-18 15:30 [gentoo-user] plain copy of root disk won't work Raffaele BELARDI
  2016-11-18 17:57 ` Canek Peláez Valdés
  2016-11-18 19:20 ` Константин
@ 2016-11-18 23:31 ` Fernando Rodriguez
  2 siblings, 0 replies; 6+ messages in thread
From: Fernando Rodriguez @ 2016-11-18 23:31 UTC (permalink / raw
  To: gentoo-user

On Fri, Nov 18, 2016 at 04:30:28PM +0100, Raffaele BELARDI wrote:
> I want to move the main disk contents (hda, PATA) to another, larger 
> disk (sda, SATA).
> 
> hda contains 4 ext3 partitions (root, home, data, swap).
> I created 4 ext3 partitions on sda and copied the data over from the 
> corresponding hda partitions using 'cp -ax'.
> Then I chroot into sda1, 'grub-install /dev/sda', grub-mkconfig and edit 
> fstab to use sda instead of hda.
> Reboot, from the non-UEFI bios change the disk boot order and try to 
> boot from sda.

Do you have a reference to your root partition on /etc/default/grub that
you forgot to update before running grub-mkconfig?


> grub from the sda starts, loads the kernel from sda1, the kernel finds 
> the root file system and mounts it RO but then the process stops at the 
> end of the kernel boot. No kernel panic, just hangs there with the last 
> kernel message before openrc. Openrc is not started.
> 
> What might I be missing?
> 
> thanks,
> 
> raffaele

-- 
Fernando Rodriguez


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] plain copy of root disk won't work
  2016-11-18 19:20 ` Константин
@ 2016-11-19 16:07   ` Frank Steinmetzger
  2016-11-21  6:19   ` [gentoo-user] plain copy of root disk won't work - SOLVED Raffaele BELARDI
  1 sibling, 0 replies; 6+ messages in thread
From: Frank Steinmetzger @ 2016-11-19 16:07 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1608 bytes --]

On Fri, Nov 18, 2016 at 10:20:13PM +0300, Константин wrote:
> On Fri, Nov 18, 2016 at 04:30:28PM +0100, Raffaele BELARDI wrote:
> > I want to move the main disk contents (hda, PATA) to another, larger
> > disk (sda, SATA).
> >
> > hda contains 4 ext3 partitions (root, home, data, swap).
> > I created 4 ext3 partitions on sda and copied the data over from the
> > corresponding hda partitions using 'cp -ax'.
> 
> Didn't you do this from working system on hda? In this case there
> really could be troubles with special files etc. Imho live-cd better
> for this purpose.
> 
> At any case imho it's better to split this task
> 
> 0. Boot from live-cd.

If I can’t be bothered with live CDs, I bind-mount the root partition. I use
that frequently to do root-backups. That way you can get the files within
/dev which are required even before /dev is populated (null and zero, IIRC).
This will, of course, not prevent files from being changed during the rsync
run, because the system is still live and kicking. So I usually run it
several times to see what has changed in the meantime.

mkdir /mnt/bindroot
mount --bind / /mnt/bindroot
rsync -ahXAHi --delete /mnt/bindroot/ /path/to/new/partition/

Since this is a bindmount, no need for -x. Use -A and -X if you use acls and
xattrs, respectively. But you definitely want -H. For example git installs
all its commands as hardlinks to a single binary.

-- 
Gruß | Greetings | Qapla’
Please do not share anything from, with or about me with any social network.

Idealism grows with the distance to the problem.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] plain copy of root disk won't work - SOLVED
  2016-11-18 19:20 ` Константин
  2016-11-19 16:07   ` Frank Steinmetzger
@ 2016-11-21  6:19   ` Raffaele BELARDI
  1 sibling, 0 replies; 6+ messages in thread
From: Raffaele BELARDI @ 2016-11-21  6:19 UTC (permalink / raw
  To: gentoo-user@lists.gentoo.org

Константин wrote:
> On Fri, Nov 18, 2016 at 04:30:28PM +0100, Raffaele BELARDI wrote:
>> I want to move the main disk contents (hda, PATA) to another, larger
>> disk (sda, SATA).
>>
>> hda contains 4 ext3 partitions (root, home, data, swap).
>> I created 4 ext3 partitions on sda and copied the data over from the
>> corresponding hda partitions using 'cp -ax'.
>
> Didn't you do this from working system on hda? In this case there
> really could be troubles with special files etc. Imho live-cd better
> for this purpose.
>

Yes, I was working from a live system. Using rsync and booting from live 
CD did the trick.

thanks,

raffaele

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-11-21  6:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-18 15:30 [gentoo-user] plain copy of root disk won't work Raffaele BELARDI
2016-11-18 17:57 ` Canek Peláez Valdés
2016-11-18 19:20 ` Константин
2016-11-19 16:07   ` Frank Steinmetzger
2016-11-21  6:19   ` [gentoo-user] plain copy of root disk won't work - SOLVED Raffaele BELARDI
2016-11-18 23:31 ` [gentoo-user] plain copy of root disk won't work Fernando Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox