public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] When copying an os to new disk
@ 2010-02-19 20:34 Harry Putnam
  2010-02-19 20:58 ` Daniel Troeder
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Harry Putnam @ 2010-02-19 20:34 UTC (permalink / raw
  To: gentoo-user

I'm currently rsyncing an OS (new gentoo install) from one vmware disk
to a newly created one.

I know not to copy /proc but not sure about /dev.  Looking at an
unbooted OS disk with an install on it... I see /dev/ is populated
(with no boot up), but I recall seeing things during boot like
`populating /dev' (I think).

So should I copy it over to new disk or not?

OH, what this is all about is maybe worth mention here for someone
else doing similar.

I opened a vmware appliance (pre made install of gentoo 1008),
thinking I'd be able to fairly quickly get it up to date.

The reason I went with the premade appliance is that I've tried
several times to get a vmware gentoo guest going but always have
trouble when booting off the newly built kernel.  I've fussed with
that repeatedly and only managed long ago to get one gentoo vmware
guest running.  (There was quite a tirade of threads initiated by me
here back then),

So anyway the appliance turned out to be a real chore to get
updated... Circular dependancies involving different versions of
portage and somekind  of api... maybe eapi1 not working with various
pkgs, all in all a big nasty circle jerk... so went ahead and tried
the `from scratch' route.

And true to form having plenty of trouble getting my kernel to see the
vmware disk I installed on, once I boot off the new kernel.

I chose to install on a scsi disk as recommended by vmwares' help.

That, I think is where the rub currently is. 

I noticed the appliance (From bagvapp) was built on an IDE disk, And
its worth noting that even when booting from the appliance,,, that
kernel doesn't see the scsi disk either... (with fdisk).

So the livecd kernel sees both the appliance IDE disk and the scsi
disk I installed on.  That kernel appears to be genkernel built and
uses the initrd approach, so all mod are in play before the actual
kernel starts booting.

Anyway, cutting to the chase, I added an IDE disk myself and am copying
the OS from the original SCSI to the IDE (I foolishly did quite a bit
of emerging and configuring from the chroot before actually testing if
it would boot so, don't wan't to lose that work and do another fresh
install).

So, I'm about to find out if any of it is going to work but wondered
about copying /dev/ over.




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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-19 20:34 [gentoo-user] When copying an os to new disk Harry Putnam
@ 2010-02-19 20:58 ` Daniel Troeder
  2010-02-19 21:25 ` Volker Armin Hemmann
  2010-02-22  7:49 ` daid kahl
  2 siblings, 0 replies; 12+ messages in thread
From: Daniel Troeder @ 2010-02-19 20:58 UTC (permalink / raw
  To: gentoo-user

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

On 02/19/2010 09:34 PM, Harry Putnam wrote:
> I'm currently rsyncing an OS (new gentoo install) from one vmware disk
> to a newly created one.
> 
> I know not to copy /proc but not sure about /dev.  Looking at an
> unbooted OS disk with an install on it... I see /dev/ is populated
> (with no boot up), but I recall seeing things during boot like
> `populating /dev' (I think).
> 
> So should I copy it over to new disk or not?
> 
> OH, what this is all about is maybe worth mention here for someone
> else doing similar.
> 
> I opened a vmware appliance (pre made install of gentoo 1008),
> thinking I'd be able to fairly quickly get it up to date.
> 
> The reason I went with the premade appliance is that I've tried
> several times to get a vmware gentoo guest going but always have
> trouble when booting off the newly built kernel.  I've fussed with
> that repeatedly and only managed long ago to get one gentoo vmware
> guest running.  (There was quite a tirade of threads initiated by me
> here back then),
> 
> So anyway the appliance turned out to be a real chore to get
> updated... Circular dependancies involving different versions of
> portage and somekind  of api... maybe eapi1 not working with various
> pkgs, all in all a big nasty circle jerk... so went ahead and tried
> the `from scratch' route.
> 
> And true to form having plenty of trouble getting my kernel to see the
> vmware disk I installed on, once I boot off the new kernel.
> 
> I chose to install on a scsi disk as recommended by vmwares' help.
> 
> That, I think is where the rub currently is. 
> 
> I noticed the appliance (From bagvapp) was built on an IDE disk, And
> its worth noting that even when booting from the appliance,,, that
> kernel doesn't see the scsi disk either... (with fdisk).
> 
> So the livecd kernel sees both the appliance IDE disk and the scsi
> disk I installed on.  That kernel appears to be genkernel built and
> uses the initrd approach, so all mod are in play before the actual
> kernel starts booting.
> 
> Anyway, cutting to the chase, I added an IDE disk myself and am copying
> the OS from the original SCSI to the IDE (I foolishly did quite a bit
> of emerging and configuring from the chroot before actually testing if
> it would boot so, don't wan't to lose that work and do another fresh
> install).
> 
> So, I'm about to find out if any of it is going to work but wondered
> about copying /dev/ over.
You can copy static /dev - no problem. When udev starts it will just
mount its own stuff over the static /dev. You do actually always need
some files to boot: at least /dev/null and often also
/dev/{tty*,console} and possibly others (depends on your init system).
Anyway: copying  /dev is a good idea.

Bye,
Daniel

-- 
PGP key @ http://pgpkeys.pca.dfn.de/pks/lookup?search=0xBB9D4887&op=get
# gpg --recv-keys --keyserver hkp://subkeys.pgp.net 0xBB9D4887


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-19 20:34 [gentoo-user] When copying an os to new disk Harry Putnam
  2010-02-19 20:58 ` Daniel Troeder
@ 2010-02-19 21:25 ` Volker Armin Hemmann
  2010-02-20  9:50   ` Xi Shen
  2010-02-22  7:49 ` daid kahl
  2 siblings, 1 reply; 12+ messages in thread
From: Volker Armin Hemmann @ 2010-02-19 21:25 UTC (permalink / raw
  To: gentoo-user

On Freitag 19 Februar 2010, Harry Putnam wrote:
> I'm currently rsyncing an OS (new gentoo install) from one vmware disk
> to a newly created one.
> 
> I know not to copy /proc but not sure about /dev.  Looking at an
> unbooted OS disk with an install on it... I see /dev/ is populated
> (with no boot up), but I recall seeing things during boot like
> `populating /dev' (I think).
> 
> So should I copy it over to new disk or not?

no. You just create /dev/null, /dev/console and /dev/zero.

Everything else is optional and not needed.

man mknod will tell you everything you need to know.




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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-19 21:25 ` Volker Armin Hemmann
@ 2010-02-20  9:50   ` Xi Shen
  0 siblings, 0 replies; 12+ messages in thread
From: Xi Shen @ 2010-02-20  9:50 UTC (permalink / raw
  To: gentoo-user

On Sat, Feb 20, 2010 at 5:25 AM, Volker Armin Hemmann
<volkerarmin@googlemail.com> wrote:
> On Freitag 19 Februar 2010, Harry Putnam wrote:
>> I'm currently rsyncing an OS (new gentoo install) from one vmware disk
>> to a newly created one.
>>
>> I know not to copy /proc but not sure about /dev.  Looking at an
>> unbooted OS disk with an install on it... I see /dev/ is populated
>> (with no boot up), but I recall seeing things during boot like
>> `populating /dev' (I think).
>>
>> So should I copy it over to new disk or not?
>
> no. You just create /dev/null, /dev/console and /dev/zero.
>

in my experience, only the /dev/null and /dev/console are required.
what does the /dev/zero for?


> Everything else is optional and not needed.
>
> man mknod will tell you everything you need to know.
>
>
>



-- 
Best Regards,
David Shen

http://twitter.com/davidshen84/



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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-19 20:34 [gentoo-user] When copying an os to new disk Harry Putnam
  2010-02-19 20:58 ` Daniel Troeder
  2010-02-19 21:25 ` Volker Armin Hemmann
@ 2010-02-22  7:49 ` daid kahl
  2010-02-25 17:59   ` daid kahl
  2 siblings, 1 reply; 12+ messages in thread
From: daid kahl @ 2010-02-22  7:49 UTC (permalink / raw
  To: gentoo-user

On 20 February 2010 05:34, Harry Putnam <reader@newsguy.com> wrote:
> I'm currently rsyncing an OS (new gentoo install) from one vmware disk
> to a newly created one.

you could dd it too, and then mount the new system and remove stuff in
/proc and /dev you don't want.

This could avoid any problems of your rsync options.  Then in a chroot
reinstall grub on the partition.

I never tried this, but to my mind it should work, and it's faster than rsync.

~daid



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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-22  7:49 ` daid kahl
@ 2010-02-25 17:59   ` daid kahl
  2010-02-26  1:06     ` Stroller
  0 siblings, 1 reply; 12+ messages in thread
From: daid kahl @ 2010-02-25 17:59 UTC (permalink / raw
  To: gentoo-user

On 22 February 2010 16:49, daid kahl <daidxor@gmail.com> wrote:
> On 20 February 2010 05:34, Harry Putnam <reader@newsguy.com> wrote:
>> I'm currently rsyncing an OS (new gentoo install) from one vmware disk
>> to a newly created one.
>
> you could dd it too, and then mount the new system and remove stuff in
> /proc and /dev you don't want.
>
> This could avoid any problems of your rsync options.  Then in a chroot
> reinstall grub on the partition.
>
> I never tried this, but to my mind it should work, and it's faster than rsync.
>
> ~daid
>

Sorry.  I should note: It *can* be faster than rsync.  If they disk
has a ton of white space, then it could very well be much slower.  But
say for a drive that is mostly at capacity, then dd should easily be a
few times faster.

As a side note, I tried dd piped through ssh and my router (with
firewall) was resetting the connection after around 4GB, and I don't
know of anyway to resume a dd.  There should be ways to ping the ssh
to keep the connection alive, but I never tried that.

But if you really want an exact copy of a system, I think dd could be
the way to go.  You can always rsync at the end to confirm.

~daid



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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-25 17:59   ` daid kahl
@ 2010-02-26  1:06     ` Stroller
  2010-02-26 11:59       ` daid kahl
  0 siblings, 1 reply; 12+ messages in thread
From: Stroller @ 2010-02-26  1:06 UTC (permalink / raw
  To: gentoo-user


On 25 Feb 2010, at 17:59, daid kahl wrote:
> ...
> As a side note, I tried dd piped through ssh and my router (with
> firewall) was resetting the connection after around 4GB, and I don't
> know of anyway to resume a dd.

NAME
        dd - convert and copy a file

SYNOPSIS
        dd [OPERAND]...
        dd OPTION

DESCRIPTION
        Copy a file, converting and formatting according to the  
operands.

        bs=BYTES
               read and write BYTES bytes at a time (also see ibs=,obs=)

...
        skip=BLOCKS
               skip BLOCKS ibs-sized blocks at start of input


HTH,

Stroller.



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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-26  1:06     ` Stroller
@ 2010-02-26 11:59       ` daid kahl
  2010-02-26 15:46         ` Kyle Bader
  0 siblings, 1 reply; 12+ messages in thread
From: daid kahl @ 2010-02-26 11:59 UTC (permalink / raw
  To: gentoo-user

On 26 February 2010 10:06, Stroller <stroller@stellar.eclipse.co.uk> wrote:
>
> On 25 Feb 2010, at 17:59, daid kahl wrote:
>>
>> ...
>> As a side note, I tried dd piped through ssh and my router (with
>> firewall) was resetting the connection after around 4GB, and I don't
>> know of anyway to resume a dd.
>
> NAME
>       dd - convert and copy a file
>
> SYNOPSIS
>       dd [OPERAND]...
>       dd OPTION
>
> DESCRIPTION
>       Copy a file, converting and formatting according to the operands.
>
>       bs=BYTES
>              read and write BYTES bytes at a time (also see ibs=,obs=)
>
> ...
>       skip=BLOCKS
>              skip BLOCKS ibs-sized blocks at start of input
>
>
> HTH,
>
> Stroller.
>

Hey, shiny!

I opted to reinstall from source that machine, which wasn't exactly a
bad choice anyway.  But as always, rtfm is good advice!  Thanks (not
sarcastic, except to mock myself).

~daid



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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-26 11:59       ` daid kahl
@ 2010-02-26 15:46         ` Kyle Bader
  2010-02-26 16:00           ` Alex Schuster
  0 siblings, 1 reply; 12+ messages in thread
From: Kyle Bader @ 2010-02-26 15:46 UTC (permalink / raw
  To: gentoo-user

> I opted to reinstall from source that machine, which wasn't exactly a
> bad choice anyway.  But as always, rtfm is good advice!  Thanks (not
> sarcastic, except to mock myself).

Another option other than rsync or dd is to use tar:

tar cf - $old_dir | ( cd $new_dir: tar xf - )
tar cf - $old_dir | ssh $other_host "( cd $new_dir: tar xf - )"

-- 

Kyle



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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-26 15:46         ` Kyle Bader
@ 2010-02-26 16:00           ` Alex Schuster
  2010-02-26 18:13             ` Kyle Bader
  2010-02-26 23:25             ` Neil Bothwick
  0 siblings, 2 replies; 12+ messages in thread
From: Alex Schuster @ 2010-02-26 16:00 UTC (permalink / raw
  To: gentoo-user

Kyle Bader writes:

> > I opted to reinstall from source that machine, which wasn't exactly a
> > bad choice anyway.  But as always, rtfm is good advice!  Thanks (not
> > sarcastic, except to mock myself).
> 
> Another option other than rsync or dd is to use tar:

Yeah, that's what I usually do.n The fastest method probably is star, 
but the syntax is a little different.

> tar cf - $old_dir | ( cd $new_dir: tar xf - )
> tar cf - $old_dir | ssh $other_host "( cd $new_dir: tar xf - )"
                                                    ^
The ':' separating commands should be a ';'. Using the -C option would be 
a little easier, but your method also would work for star. This piping 
through ssh is quite cool, isn't it.

If $old_dir is the root partition, I would bin-mount it first to somewhere 
else, so other directories mounted to it (especially/dev, /proc and /sys) 
are not copied:
mount -o bind / /mnt
old_dir=/mnt

	Wonko



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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-26 16:00           ` Alex Schuster
@ 2010-02-26 18:13             ` Kyle Bader
  2010-02-26 23:25             ` Neil Bothwick
  1 sibling, 0 replies; 12+ messages in thread
From: Kyle Bader @ 2010-02-26 18:13 UTC (permalink / raw
  To: gentoo-user

>> tar cf - $old_dir | ( cd $new_dir: tar xf - )
>> tar cf - $old_dir | ssh $other_host "( cd $new_dir: tar xf - )"
>                                                    ^
> The ':' separating commands should be a ';'. Using the -C option would be
> a little easier, but your method also would work for star. This piping
> through ssh is quite cool, isn't it.

whoops, good catch!

> If $old_dir is the root partition, I would bin-mount it first to somewhere
> else, so other directories mounted to it (especially/dev, /proc and /sys)
> are not copied:
> mount -o bind / /mnt
> old_dir=/mnt

that too, copying over /proc/kcore is never fun ;P
-- 

Kyle



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

* Re: [gentoo-user] When copying an os to new disk
  2010-02-26 16:00           ` Alex Schuster
  2010-02-26 18:13             ` Kyle Bader
@ 2010-02-26 23:25             ` Neil Bothwick
  1 sibling, 0 replies; 12+ messages in thread
From: Neil Bothwick @ 2010-02-26 23:25 UTC (permalink / raw
  To: gentoo-user

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

On Fri, 26 Feb 2010 17:00:22 +0100, Alex Schuster wrote:

> If $old_dir is the root partition, I would bin-mount it first to
> somewhere else, so other directories mounted to it
> (especially/dev, /proc and /sys) are not copied:
> mount -o bind / /mnt
> old_dir=/mnt

Or use the --one-file-system option for tar.


-- 
Neil Bothwick

I locked my coathanger in my car; good thing I had a key.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

end of thread, other threads:[~2010-02-26 23:26 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-19 20:34 [gentoo-user] When copying an os to new disk Harry Putnam
2010-02-19 20:58 ` Daniel Troeder
2010-02-19 21:25 ` Volker Armin Hemmann
2010-02-20  9:50   ` Xi Shen
2010-02-22  7:49 ` daid kahl
2010-02-25 17:59   ` daid kahl
2010-02-26  1:06     ` Stroller
2010-02-26 11:59       ` daid kahl
2010-02-26 15:46         ` Kyle Bader
2010-02-26 16:00           ` Alex Schuster
2010-02-26 18:13             ` Kyle Bader
2010-02-26 23:25             ` Neil Bothwick

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