FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 02-19-2010, 07:34 PM
Harry Putnam
 
Default When copying an os to new disk

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.
 
Old 02-19-2010, 07:58 PM
Daniel Troeder
 
Default When copying an os to new disk

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
 
Old 02-19-2010, 08:25 PM
Volker Armin Hemmann
 
Default When copying an os to new disk

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.
 
Old 02-20-2010, 08:50 AM
Xi Shen
 
Default When copying an os to new disk

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/
 
Old 02-22-2010, 06:49 AM
daid kahl
 
Default When copying an os to new disk

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
 
Old 02-25-2010, 04:59 PM
daid kahl
 
Default When copying an os to new disk

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
 
Old 02-26-2010, 12:06 AM
Stroller
 
Default When copying an os to new disk

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.
 
Old 02-26-2010, 10:59 AM
daid kahl
 
Default When copying an os to new disk

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
 
Old 02-26-2010, 02:46 PM
Kyle Bader
 
Default When copying an os to new disk

> 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
 
Old 02-26-2010, 03:00 PM
Alex Schuster
 
Default When copying an os to new disk

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
 

Thread Tools




All times are GMT. The time now is 04:12 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org