* Re: [gentoo-user] Moving linux system to another partition
2007-06-08 15:48 ` Alan McKinnon
@ 2007-06-08 15:59 ` Albert Hopkins
2007-06-08 16:21 ` Aleksey Kunitskiy
2007-06-08 16:43 ` Tim Allingham
2007-06-08 22:38 ` Dale
2 siblings, 1 reply; 20+ messages in thread
From: Albert Hopkins @ 2007-06-08 15:59 UTC (permalink / raw
To: gentoo-user
On Fri, 2007-06-08 at 17:48 +0200, Alan McKinnon wrote:
> What the OP *will* have a problem with a copying /proc, /dev, /sys
> and
> other virtual filesystems. When I do this trick, I usually dd or tar
> or
> cp -a entire filesystems and then copy / with this trick:
>
> mount -o bind / /some/tmp/dir
> cp -a /some/tmp/dir /some/other/dir
>
> This ensures that only files actually on-disk are copied
You could also pass, '-x' to cp and rsync or '--one-file-system' to tar.
--
Albert W. Hopkins
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Moving linux system to another partition
2007-06-08 15:48 ` Alan McKinnon
2007-06-08 15:59 ` Albert Hopkins
@ 2007-06-08 16:43 ` Tim Allingham
2007-06-08 18:52 ` Hans-Werner Hilse
2007-06-08 22:38 ` Dale
2 siblings, 1 reply; 20+ messages in thread
From: Tim Allingham @ 2007-06-08 16:43 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1467 bytes --]
On Fri, 2007-06-08 at 17:48 +0200, Alan McKinnon wrote:
> On Friday 08 June 2007, Hemmann, Volker Armin wrote:
> > On Freitag, 8. Juni 2007, Aleksey Kunitskiy wrote:
> > > Hi all,
> > >
> > > Is it safe to move my linux system by using:
> > > #>cp -rp /mnt/old_part /mnt/new_part
> > > and approriate changes in grub.conf/fstab on new system location ?
> >
> > nope.
> >
> > cp -a if you really want to use copy. But doesn't kill that the
> > ctime/mtime making uninstalling things a pain?
>
> No.
>
> cp -a is equivalent to cp -dpPR
>
> and from the man page:
>
> -p same as --preserve=mode,ownership,timestamps
>
> What the OP *will* have a problem with a copying /proc, /dev, /sys and
> other virtual filesystems. When I do this trick, I usually dd or tar or
> cp -a entire filesystems and then copy / with this trick:
>
> mount -o bind / /some/tmp/dir
> cp -a /some/tmp/dir /some/other/dir
>
> This ensures that only files actually on-disk are copied
>
> alan
>
>
> --
> Optimists say the glass is half full,
> Pessimists say the glass is half empty,
> Developers say wtf is the glass twice as big as it needs to be?
>
> Alan McKinnon
> alan at linuxholdings dot co dot za
> +27 82, double three seven, one nine three five
I generally prefer to do this with dd, from a remote environment
dd if=/dev/<source partition> of=/dev/<destination partition>
Tim Allingham
tim -at- datafirst-it.com.au
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Moving linux system to another partition
2007-06-08 16:43 ` Tim Allingham
@ 2007-06-08 18:52 ` Hans-Werner Hilse
2007-06-09 18:25 ` Tim Allingham
2007-06-11 7:24 ` Mick
0 siblings, 2 replies; 20+ messages in thread
From: Hans-Werner Hilse @ 2007-06-08 18:52 UTC (permalink / raw
To: gentoo-user
Hi,
On Sat, 09 Jun 2007 02:43:23 +1000
Tim Allingham <deserted@westnet.com.au> wrote:
> I generally prefer to do this with dd, from a remote environment
>
> dd if=/dev/<source partition> of=/dev/<destination partition>
"Remote Environment" probably means a) read-only mounted root FS or b)
a boot into another instance, e.g. a live-CD, right? If you're talking
about just SSH'ing into the machine: That will probably cause the copy
to be broken (if the machine has / still mounted r/w), at least an fsck
would be needed.
Also, this method will also need a bigger or equally sized new
partition. If it's bigger, one also needs to resize the filesystem
afterwards.
-hwh
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Moving linux system to another partition
2007-06-08 18:52 ` Hans-Werner Hilse
@ 2007-06-09 18:25 ` Tim Allingham
2007-06-11 7:24 ` Mick
1 sibling, 0 replies; 20+ messages in thread
From: Tim Allingham @ 2007-06-09 18:25 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 921 bytes --]
On Fri, 2007-06-08 at 20:52 +0200, Hans-Werner Hilse wrote:
> Hi,
>
> On Sat, 09 Jun 2007 02:43:23 +1000
> Tim Allingham <deserted@westnet.com.au> wrote:
>
> > I generally prefer to do this with dd, from a remote environment
> >
> > dd if=/dev/<source partition> of=/dev/<destination partition>
>
> "Remote Environment" probably means a) read-only mounted root FS or b)
> a boot into another instance, e.g. a live-CD, right? If you're talking
> about just SSH'ing into the machine: That will probably cause the copy
> to be broken (if the machine has / still mounted r/w), at least an fsck
> would be needed.
>
> Also, this method will also need a bigger or equally sized new
> partition. If it's bigger, one also needs to resize the filesystem
> afterwards.
>
> -hwh
yeah that probably wasn't the best terminology to use, I was referring
to liveCD/alternate OS as opposed to remote access
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Moving linux system to another partition
2007-06-08 18:52 ` Hans-Werner Hilse
2007-06-09 18:25 ` Tim Allingham
@ 2007-06-11 7:24 ` Mick
2007-06-11 8:58 ` Hans-Werner Hilse
1 sibling, 1 reply; 20+ messages in thread
From: Mick @ 2007-06-11 7:24 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 933 bytes --]
On Friday 08 June 2007 19:52, Hans-Werner Hilse wrote:
> Hi,
>
> On Sat, 09 Jun 2007 02:43:23 +1000
>
> Tim Allingham <deserted@westnet.com.au> wrote:
> > I generally prefer to do this with dd, from a remote environment
> >
> > dd if=/dev/<source partition> of=/dev/<destination partition>
>
> "Remote Environment" probably means a) read-only mounted root FS or b)
> a boot into another instance, e.g. a live-CD, right? If you're talking
> about just SSH'ing into the machine: That will probably cause the copy
> to be broken (if the machine has / still mounted r/w), at least an fsck
> would be needed.
>
> Also, this method will also need a bigger or equally sized new
> partition. If it's bigger, one also needs to resize the filesystem
> afterwards.
How do you resize the fs? I was never comfortable trying this at home... but I
have a feeling I might need to use it sooner or later.
--
Regards,
Mick
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Moving linux system to another partition
2007-06-11 7:24 ` Mick
@ 2007-06-11 8:58 ` Hans-Werner Hilse
2007-06-11 15:18 ` Randy Barlow
0 siblings, 1 reply; 20+ messages in thread
From: Hans-Werner Hilse @ 2007-06-11 8:58 UTC (permalink / raw
To: gentoo-user
Hi,
On Mon, 11 Jun 2007 08:24:00 +0100 Mick <michaelkintzios@gmail.com>
wrote:
> On Friday 08 June 2007 19:52, Hans-Werner Hilse wrote:
>
> > Also, this method will also need a bigger or equally sized new
> > partition. If it's bigger, one also needs to resize the filesystem
> > afterwards.
>
> How do you resize the fs? I was never comfortable trying this at
> home... but I have a feeling I might need to use it sooner or later.
This is file system specific. There's e.g. resize2fs, xfs_growfs and
other programs for the other FS. Of course, there's no need to grow the
filesystem, but you won't have more space than before because file
systems don't usually adapt to partition size.
-hwh
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Moving linux system to another partition
2007-06-11 8:58 ` Hans-Werner Hilse
@ 2007-06-11 15:18 ` Randy Barlow
2007-06-11 14:54 ` Alan McKinnon
2007-06-11 15:00 ` Hans-Werner Hilse
0 siblings, 2 replies; 20+ messages in thread
From: Randy Barlow @ 2007-06-11 15:18 UTC (permalink / raw
To: gentoo-user
Hans-Werner Hilse wrote:
> Of course, there's no need to grow the
> filesystem, but you won't have more space than before because file
> systems don't usually adapt to partition size.
I am confused as to what you mean here. It is my experience that
resizing a file system that has been dd'ed to a new, larger partition
will cause it to take up that entire new partition (which is desirable).
Are you saying this is not the case?
R
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Moving linux system to another partition
2007-06-11 15:18 ` Randy Barlow
@ 2007-06-11 14:54 ` Alan McKinnon
2007-06-11 15:00 ` Hans-Werner Hilse
1 sibling, 0 replies; 20+ messages in thread
From: Alan McKinnon @ 2007-06-11 14:54 UTC (permalink / raw
To: gentoo-user
On Monday 11 June 2007, Randy Barlow wrote:
> Hans-Werner Hilse wrote:
> > Of course, there's no need to grow the
> > filesystem, but you won't have more space than before because file
> > systems don't usually adapt to partition size.
>
> I am confused as to what you mean here. It is my experience that
> resizing a file system that has been dd'ed to a new, larger partition
> will cause it to take up that entire new partition (which is
> desirable). Are you saying this is not the case?
No, he's saying that you don't *have* to resize the fs, but then all
that happens is you have a (say) 60GB fs on a 100GB partition, wasting
40GB of disk space. He also say it would be nice to have an fs that
dynamically resizes itself if it finds it's not using all of the
partition, but that's not the usual way it works (if at all).
Hans-Werner's post is correct but also in convulted language with a
triple negative. Your original understanding is correct.
alan
--
Optimists say the glass is half full,
Pessimists say the glass is half empty,
Developers say wtf is the glass twice as big as it needs to be?
Alan McKinnon
alan at linuxholdings dot co dot za
+27 82, double three seven, one nine three five
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Moving linux system to another partition
2007-06-11 15:18 ` Randy Barlow
2007-06-11 14:54 ` Alan McKinnon
@ 2007-06-11 15:00 ` Hans-Werner Hilse
1 sibling, 0 replies; 20+ messages in thread
From: Hans-Werner Hilse @ 2007-06-11 15:00 UTC (permalink / raw
To: gentoo-user
Hi,
On Mon, 11 Jun 2007 10:18:27 -0500 Randy Barlow
<randy@electronsweatshop.com> wrote:
> Hans-Werner Hilse wrote:
> > Of course, there's no need to grow the
> > filesystem, but you won't have more space than before because file
> > systems don't usually adapt to partition size.
>
> I am confused as to what you mean here. It is my experience that
> resizing a file system that has been dd'ed to a new, larger partition
> will cause it to take up that entire new partition (which is
> desirable). Are you saying this is not the case?
Nope, I was merely saying that resizing is *not* a necessity, except
you want to use the (larger) space of the partition. A filesystem
doesn't really care for the size of the partition. That's what I wanted
to express... just that it doesn't happen automatically, and on the
other hand is not necessary in order to use the old data.
-hwh
--
gentoo-user@gentoo.org mailing list
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [gentoo-user] Moving linux system to another partition
2007-06-08 15:48 ` Alan McKinnon
2007-06-08 15:59 ` Albert Hopkins
2007-06-08 16:43 ` Tim Allingham
@ 2007-06-08 22:38 ` Dale
2 siblings, 0 replies; 20+ messages in thread
From: Dale @ 2007-06-08 22:38 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]
Alan McKinnon wrote:
> On Friday 08 June 2007, Hemmann, Volker Armin wrote:
>
>> On Freitag, 8. Juni 2007, Aleksey Kunitskiy wrote:
>>
>>> Hi all,
>>>
>>> Is it safe to move my linux system by using:
>>> #>cp -rp /mnt/old_part /mnt/new_part
>>> and approriate changes in grub.conf/fstab on new system location ?
>>>
>> nope.
>>
>> cp -a if you really want to use copy. But doesn't kill that the
>> ctime/mtime making uninstalling things a pain?
>>
>
> No.
>
> cp -a is equivalent to cp -dpPR
>
> and from the man page:
>
> -p same as --preserve=mode,ownership,timestamps
>
> What the OP *will* have a problem with a copying /proc, /dev, /sys and
> other virtual filesystems. When I do this trick, I usually dd or tar or
> cp -a entire filesystems and then copy / with this trick:
>
> mount -o bind / /some/tmp/dir
> cp -a /some/tmp/dir /some/other/dir
>
> This ensures that only files actually on-disk are copied
>
> alan
>
>
>
This is something I have done several times. This is how I do it. Boot
the Gentoo CD or some other live CD, Knoppix should work. After you get
booted up, mount the partitions, old and new, then use this command: cp
-av /path/to/old /path/to/new and sit back and watch it all scroll by.
It may take a good while depending on how much stuff you have to copy.
I'm not saying that someone else doesn't have a better idea. I have
seen where people tar the stuff then untar it to the new drive. To me,
it is a useless step. What I use has worked for me every time and I
have done it quite a bit.
I hope that helps.
Dale
:-) :-) :-) :-)
[-- Attachment #2: Type: text/html, Size: 2169 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread