public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] Moving linux system to another partition
@ 2007-06-08 15:05 Aleksey Kunitskiy
  2007-06-08 15:18 ` Hemmann, Volker Armin
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Aleksey Kunitskiy @ 2007-06-08 15:05 UTC (permalink / raw
  To: gentoo-user

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 ?

-- 
best regards,
Aleksey V. Kunitskiy
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
  2007-06-08 15:05 [gentoo-user] Moving linux system to another partition Aleksey Kunitskiy
@ 2007-06-08 15:18 ` Hemmann, Volker Armin
  2007-06-08 15:48   ` Alan McKinnon
       [not found]   ` <200706081839.07324.alexey.kv@gmail.com>
  2007-06-08 15:54 ` Albert Hopkins
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 27+ messages in thread
From: Hemmann, Volker Armin @ 2007-06-08 15:18 UTC (permalink / raw
  To: gentoo-user

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?

When I moved around on harddisks some years ago, I followed some instructions 
found on the suse-hp. And they used tar.
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
  2007-06-08 15:18 ` Hemmann, Volker Armin
@ 2007-06-08 15:48   ` Alan McKinnon
  2007-06-08 15:59     ` Albert Hopkins
                       ` (2 more replies)
       [not found]   ` <200706081839.07324.alexey.kv@gmail.com>
  1 sibling, 3 replies; 27+ messages in thread
From: Alan McKinnon @ 2007-06-08 15:48 UTC (permalink / raw
  To: gentoo-user

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
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
  2007-06-08 15:05 [gentoo-user] Moving linux system to another partition Aleksey Kunitskiy
  2007-06-08 15:18 ` Hemmann, Volker Armin
@ 2007-06-08 15:54 ` Albert Hopkins
  2007-06-08 16:01   ` Mauro Faccenda
  2007-06-08 16:25 ` [gentoo-user] " Remy Blank
  2007-06-09  8:45 ` [gentoo-user] " Vladimir Rusinov
  3 siblings, 1 reply; 27+ messages in thread
From: Albert Hopkins @ 2007-06-08 15:54 UTC (permalink / raw
  To: gentoo-user

On Fri, 2007-06-08 at 18:05 +0300, 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 ?

'cp -a' (or better rsync -a) is probably better than 'cp -rp' for that
purpose.  But what I usually do is 'tar -c ... | tar -x ...'.  I don't
really know if it's better or not than using 'cp'. I just do it out of
habit.


--
Albert W. Hopkins

-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
       [not found]   ` <200706081839.07324.alexey.kv@gmail.com>
@ 2007-06-08 15:59     ` Mauro Faccenda
  0 siblings, 0 replies; 27+ messages in thread
From: Mauro Faccenda @ 2007-06-08 15:59 UTC (permalink / raw
  To: gentoo-user; +Cc: Aleksey Kunitskiy

On Friday 08 June 2007 12:39, Aleksey Kunitskiy wrote:

> > When I moved around on harddisks some years ago, I followed some
> > instructions found on the suse-hp. And they used tar.
>
> Any helpful suggestions(links?) ?

if you are doing it between different filesystems, keep in mind that some 
doesn't store the same informations about the files...

and would be better if the filesystem from where you will copy, is mounted in 
read-only mode.

if you are only aware about permissions, you can use "tar -p" but, if the 
destination filesystem is the same or unix-like (not vfat or ntfs) i'd prefer 
using "rsync -a" to doing this job.

but if you have any doubt... the manual is your friend. ;)

man tar
man rsync
man cp

[]'s
	.m
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ 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:21       ` Aleksey Kunitskiy
  2007-06-08 16:43     ` Tim Allingham
  2007-06-08 22:38     ` Dale
  2 siblings, 1 reply; 27+ 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] 27+ messages in thread

* Re: [gentoo-user] Moving linux system to another partition
  2007-06-08 15:54 ` Albert Hopkins
@ 2007-06-08 16:01   ` Mauro Faccenda
  2007-06-08 18:09     ` Benno Schulenberg
  0 siblings, 1 reply; 27+ messages in thread
From: Mauro Faccenda @ 2007-06-08 16:01 UTC (permalink / raw
  To: gentoo-user; +Cc: Albert Hopkins

On Friday 08 June 2007 12:54, Albert Hopkins wrote:
> On Fri, 2007-06-08 at 18:05 +0300, 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 ?
>
> 'cp -a' (or better rsync -a) is probably better than 'cp -rp' for that
> purpose.  But what I usually do is 'tar -c ... | tar -x ...'.  I don't
> really know if it's better or not than using 'cp'. I just do it out of
> habit.

if you do tar in this way, is better to use "tar -pc ... | tar -px ..."

[]'s
	.m
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
  2007-06-08 15:59     ` Albert Hopkins
@ 2007-06-08 16:21       ` Aleksey Kunitskiy
  0 siblings, 0 replies; 27+ messages in thread
From: Aleksey Kunitskiy @ 2007-06-08 16:21 UTC (permalink / raw
  To: gentoo-user

On Friday 08 June 2007 18:59, Albert Hopkins wrote:
> You could also pass, '-x' to cp and rsync or '--one-file-system' to tar.

Thanks. 

I found good howto [1], chapter #7 describes this problem

[1] http://www.tldp.org/HOWTO/Hard-Disk-Upgrade/

-- 
best regards,
Aleksey V. Kunitskiy
-- 
gentoo-user@gentoo.org mailing list



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

* [gentoo-user]  Re: Moving linux system to another partition
  2007-06-08 15:05 [gentoo-user] Moving linux system to another partition Aleksey Kunitskiy
  2007-06-08 15:18 ` Hemmann, Volker Armin
  2007-06-08 15:54 ` Albert Hopkins
@ 2007-06-08 16:25 ` Remy Blank
  2007-06-09  8:45 ` [gentoo-user] " Vladimir Rusinov
  3 siblings, 0 replies; 27+ messages in thread
From: Remy Blank @ 2007-06-08 16:25 UTC (permalink / raw
  To: gentoo-user

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aleksey Kunitskiy wrote:
> 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 ?

I have used "rsync -avH" in the past (-H preserves hardlinks), and with
more recent versions of rsync (and if you have ACLs or XATTRs), I would
use "rsync -avHAX".

And yes, do ensure that nothing writes to the partition while you're
copying, so the best thing is probably to do that from a LiveCD, where
the source partition is mounted read-only.

- -- Remy
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGaYMVCeNfIyhvXjIRAnE5AKCJyDKNWh4J44Hats5BeCahIL8ySwCgsqO4
Q+LqEzrKkdVaXfsz4OiL7fA=
=UgW+
-----END PGP SIGNATURE-----

-- 
gentoo-user@gentoo.org mailing list



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

* RE: [gentoo-user] Moving linux system to another partition
@ 2007-06-08 16:40 burlingk
  0 siblings, 0 replies; 27+ messages in thread
From: burlingk @ 2007-06-08 16:40 UTC (permalink / raw
  To: gentoo-user



> -----Original Message-----
> From: Hemmann, Volker Armin 
> [mailto:volker.armin.hemmann@tu-clausthal.de] 
> Sent: Saturday, June 09, 2007 12:19 AM
> To: gentoo-user@lists.gentoo.org
> Subject: Re: [gentoo-user] Moving linux system to another partition
> 
> 
> 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?
> 
> When I moved around on harddisks some years ago, I followed 
> some instructions 
> found on the suse-hp. And they used tar.

***********WARNING***********
I am probably missing something, so beware.  I am sure people with
more experience will fill in the details, so don't try this till
everyone else has a chance to chime in. :P

I don't know all the details, but from what I understand basically boot
into 
a live disk type environment, tar everything in a way that reserves
permissions
and all the file info, and then untar it in the new root directory.

If grub.conf will be in a new location, then make sure to make the right
Changes in grub.  If you have a separate /boot parition, then that
should
be ok, just make the right changes in grub.conf.

That SHOULD work. ^^;
Make sure not to actually delete anything until you know it works. ^_^


--
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ 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; 27+ 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] 27+ messages in thread

* RE: [gentoo-user] Moving linux system to another partition
@ 2007-06-08 16:52 burlingk
  0 siblings, 0 replies; 27+ messages in thread
From: burlingk @ 2007-06-08 16:52 UTC (permalink / raw
  To: gentoo-user



> -----Original Message-----
> From: Alan McKinnon [mailto:alan@linuxholdings.co.za] 
> Sent: Saturday, June 09, 2007 12:48 AM
> To: gentoo-user@lists.gentoo.org
> Subject: Re: [gentoo-user] Moving linux system to another partition
> 
> 
> 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
Is it possible to handle the tar process from inside a liveCD
environment, and just tar the mount points (i.e. empty directories)
for the virtual file systems instead of trying to tar the virtaul
file systems themselves?  Afterall, they are recreated at boot
time, aren't they?
--
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
  2007-06-08 16:01   ` Mauro Faccenda
@ 2007-06-08 18:09     ` Benno Schulenberg
  0 siblings, 0 replies; 27+ messages in thread
From: Benno Schulenberg @ 2007-06-08 18:09 UTC (permalink / raw
  To: gentoo-user

Mauro Faccenda wrote:
> On Friday 08 June 2007 12:54, Albert Hopkins wrote:
> > On Fri, 2007-06-08 at 18:05 +0300, Aleksey Kunitskiy wrote:
> > > Is it safe to move my linux system by using:
> > > #>cp -rp /mnt/old_part /mnt/new_part
> >
> > 'cp -a' (or better rsync -a) is probably better than 'cp -rp'
> > for that purpose.  But what I usually do is 'tar -c ... | tar
> > -x ...'.
>
> if you do tar in this way, is better to use 
> "tar -pc ... | tar -px ..."

The -p option only does something when extracting an archive, so 
that first -p is pointless.  Better use 'tar' instead of 'cp -a', 
though, as it's much faster when copying many little files.

  cd /sourcedir && tar -cf - .  |  (cd /destdir; tar -xpvf -)

Benno
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 27+ 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; 27+ 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] 27+ 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; 27+ 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] 27+ messages in thread

* Re: [gentoo-user] Moving linux system to another partition
@ 2007-06-09  0:01 jamesc
  2007-06-09  0:25 ` Albert Hopkins
  0 siblings, 1 reply; 27+ messages in thread
From: jamesc @ 2007-06-09  0:01 UTC (permalink / raw
  To: gentoo-user

On Fri Jun  8 16:38 , Dale <dalek@exceedtech.net> sent:

>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.


Yeah, that's me, I do exactly the same until you issue the cp command where I do:
$>cd /mnt/oldstuff && tar cvjpf /pathtosomewhere/mystuff.tbz ./
and then extract to the new directory.  I do this out of habit mostly and, yes,
it is a useless step unless you want to store a copy somewhere for whatever reason...

--James
--
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
@ 2007-06-09  0:18 jamesc
  0 siblings, 0 replies; 27+ messages in thread
From: jamesc @ 2007-06-09  0:18 UTC (permalink / raw
  To: gentoo-user

On Fri Jun  8 12:09 , Benno Schulenberg <benno.schulenberg@gmail.com> sent:

>The -p option only does something when extracting an archive, so 
>that first -p is pointless.

Cool.  I thought you were mistaken however, upon consulting the man page, you are
absolutely correct.  Thanks for that.

--James
--
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
  2007-06-09  0:01 jamesc
@ 2007-06-09  0:25 ` Albert Hopkins
  2007-06-09  8:14   ` Florian Philipp
  0 siblings, 1 reply; 27+ messages in thread
From: Albert Hopkins @ 2007-06-09  0:25 UTC (permalink / raw
  To: gentoo-user

On Fri, 2007-06-08 at 19:01 -0500, jamesc@reliant-data.com wrote:
> On Fri Jun  8 16:38 , Dale <dalek@exceedtech.net> sent:

> 
> Yeah, that's me, I do exactly the same until you issue the cp command where I do:
> $>cd /mnt/oldstuff && tar cvjpf /pathtosomewhere/mystuff.tbz ./
> and then extract to the new directory.  I do this out of habit mostly and, yes,
> it is a useless step unless you want to store a copy somewhere for whatever reason...
> 
> --James

The one thing I mentioned is that I actually pipe tar to tar (tar -c ...
| tar -x ...) which seems even more useless, but as I said I'm used to
doing some things out of habit.  Then I thought about why: the '-a' flag
is not available on all *nices... I believe it's a GNU extension.  So I
probably got used to using the tar trick on a non-GNU system and got
used to it because it works whether I'm using Linux or not.  But if
you're on a Linux system (that has rsync installed) then rsync is
probably the nicer option.  It's got even more options than GNU's cp.  I
actually 'alias cp="rsync"' on my Gentoo systems.

'dd' is good if you want to preserve filesystem/geometry but not good if
you don't. 
--
Albert W. Hopkins

-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
@ 2007-06-09  0:43 jamesc
  0 siblings, 0 replies; 27+ messages in thread
From: jamesc @ 2007-06-09  0:43 UTC (permalink / raw
  To: gentoo-user

On Fri Jun  8 18:25 , Albert Hopkins <marduk@gentoo.org> sent:

>On Fri, 2007-06-08 at 19:01 -0500, jamesc@reliant-data.com wrote:
>> On Fri Jun  8 16:38 , Dale dalek@exceedtech.net> sent:
>
>> 
>> Yeah, that's me, I do exactly the same until you issue the cp command where I do:
>> $>cd /mnt/oldstuff && tar cvjpf /pathtosomewhere/mystuff.tbz ./
>> and then extract to the new directory.  I do this out of habit mostly and, yes,
>> it is a useless step unless you want to store a copy somewhere for whatever
reason...
>> 
>> --James
>
>The one thing I mentioned is that I actually pipe tar to tar (tar -c ...
>| tar -x ...) which seems even more useless, but as I said I'm used to
>doing some things out of habit.  Then I thought about why: the '-a' flag
>is not available on all *nices... I believe it's a GNU extension.  So I
>probably got used to using the tar trick on a non-GNU system and got
>used to it because it works whether I'm using Linux or not.  But if
>you're on a Linux system (that has rsync installed) then rsync is
>probably the nicer option.  It's got even more options than GNU's cp.  I
>actually 'alias cp="rsync"' on my Gentoo systems.

Ha.  This is a good day.  I have to laugh at myself for not utilizing rsync more;
for the last few years I've just been using rsync to backup/restore my /home and
key config files to my fileserver (while at home).  Never even considered using
it for local operations.  Nice.  I have the habit, also, of using the most basic
stuff since I'm usually on all manner of UNIX{like} boxes during the day.

Thanks,
--James


--
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] Moving linux system to another partition
  2007-06-09  0:25 ` Albert Hopkins
@ 2007-06-09  8:14   ` Florian Philipp
  0 siblings, 0 replies; 27+ messages in thread
From: Florian Philipp @ 2007-06-09  8:14 UTC (permalink / raw
  To: gentoo-user

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

Am Samstag 09 Juni 2007 02:25 schrieb Albert Hopkins:
> On Fri, 2007-06-08 at 19:01 -0500, jamesc@reliant-data.com wrote:
> > On Fri Jun  8 16:38 , Dale <dalek@exceedtech.net> sent:
> >
> >
> > Yeah, that's me, I do exactly the same until you issue the cp command
> > where I do: $>cd /mnt/oldstuff && tar cvjpf /pathtosomewhere/mystuff.tbz
> > ./
> > and then extract to the new directory.  I do this out of habit mostly
> > and, yes, it is a useless step unless you want to store a copy somewhere
> > for whatever reason...
> >
> > --James
>
> The one thing I mentioned is that I actually pipe tar to tar (tar -c ...
>
> | tar -x ...) which seems even more useless, but as I said I'm used to
>
> doing some things out of habit.  Then I thought about why: the '-a' flag
> is not available on all *nices... I believe it's a GNU extension.  So I
> probably got used to using the tar trick on a non-GNU system and got
> used to it because it works whether I'm using Linux or not.  But if
> you're on a Linux system (that has rsync installed) then rsync is
> probably the nicer option.  It's got even more options than GNU's cp.  I
> actually 'alias cp="rsync"' on my Gentoo systems.
>
> 'dd' is good if you want to preserve filesystem/geometry but not good if
> you don't.
> --
> Albert W. Hopkins

I wouldn't recommend dd, either. Using dd you would preserve all the 
fragmentation of the old file system while cp, tar and rsync don't.

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

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

* Re: [gentoo-user] Moving linux system to another partition
  2007-06-08 15:05 [gentoo-user] Moving linux system to another partition Aleksey Kunitskiy
                   ` (2 preceding siblings ...)
  2007-06-08 16:25 ` [gentoo-user] " Remy Blank
@ 2007-06-09  8:45 ` Vladimir Rusinov
  3 siblings, 0 replies; 27+ messages in thread
From: Vladimir Rusinov @ 2007-06-09  8:45 UTC (permalink / raw
  To: gentoo-user

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

On 6/8/07, Aleksey Kunitskiy <alexey.kv@gmail.com> wrote:
>
> 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 ?
>

cp -ax / /mnt/newroot
cp -ax /dev/ /mnt/newroot

Is always works for mine. Second line required in order to boot.


-- 
Vladimir Rusinov
GreenMice Solutions: IT-решения на базе Linux
http://greenmice.info/

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

^ permalink raw reply	[flat|nested] 27+ 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; 27+ 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] 27+ 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; 27+ 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] 27+ 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; 27+ 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] 27+ 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; 27+ 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] 27+ 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; 27+ 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] 27+ 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; 27+ 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] 27+ messages in thread

end of thread, other threads:[~2007-06-11 15:10 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-08 15:05 [gentoo-user] Moving linux system to another partition Aleksey Kunitskiy
2007-06-08 15:18 ` Hemmann, Volker Armin
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 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
2007-06-11 15:18             ` Randy Barlow
2007-06-11 14:54               ` Alan McKinnon
2007-06-11 15:00               ` Hans-Werner Hilse
2007-06-08 22:38     ` Dale
     [not found]   ` <200706081839.07324.alexey.kv@gmail.com>
2007-06-08 15:59     ` Mauro Faccenda
2007-06-08 15:54 ` Albert Hopkins
2007-06-08 16:01   ` Mauro Faccenda
2007-06-08 18:09     ` Benno Schulenberg
2007-06-08 16:25 ` [gentoo-user] " Remy Blank
2007-06-09  8:45 ` [gentoo-user] " Vladimir Rusinov
  -- strict thread matches above, loose matches on Subject: below --
2007-06-08 16:40 burlingk
2007-06-08 16:52 burlingk
2007-06-09  0:01 jamesc
2007-06-09  0:25 ` Albert Hopkins
2007-06-09  8:14   ` Florian Philipp
2007-06-09  0:18 jamesc
2007-06-09  0:43 jamesc

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