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 > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 01-18-2008, 04:06 AM
"Daniel B. Thurman"
 
Default Need help with tar or how to copy root to new drive?

I am having a hard time simply trying to copy my root partition to a new
drive and somehow tar is not doing what I expected. Can someone advise
me how to do it correctly?

I tried:

1) mkdir /mnt/new
2) mount /dev/sdc3 /mnt/new
3) cd /mnt/new
4) (cd /; tar --one-file-system --xattrs -cf - .) | tar --one-file-system --xattrs -tvf -)
[result: All mounted filesystems are copied over] Drat!

The only other possibility that comes to my mind is to mount the root drive
to /mnt/root read-only. mount the new drive to /mnt/new, and then tar-copy
but this may have consequences with the currently mounted root filesystem?

Please advise.

Thanks!
Dan

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 01-18-2008, 04:39 AM
"Daniel B. Thurman"
 
Default Need help with tar or how to copy root to new drive?

[2nd try: Seems that my outgoing email is not reaching fedora-list...]

I am having a hard time simply trying to copy my root partition to a new
drive and somehow tar is not doing what I expected. Can someone advise
me how to do it correctly?

I tried:

1) mkdir /mnt/new
2) mount /dev/sdc3 /mnt/new
3) cd /mnt/new
4) (cd /; tar --one-file-system --xattrs -cf - .) | tar --one-file-system --xattrs -tvf -)
[result: All mounted filesystems are copied over] Drat!

The only other possibility that comes to my mind is to mount the root drive
to /mnt/root read-only. mount the new drive to /mnt/new, and then tar-copy
but this may have consequences with the currently mounted root filesystem?

Please advise.

Thanks!
Dan

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 01-18-2008, 05:43 AM
Les Mikesell
 
Default Need help with tar or how to copy root to new drive?

Daniel B. Thurman wrote:

I am having a hard time simply trying to copy my root partition to a new
drive and somehow tar is not doing what I expected. Can someone advise
me how to do it correctly?

I tried:

1) mkdir /mnt/new
2) mount /dev/sdc3 /mnt/new
3) cd /mnt/new
4) (cd /; tar --one-file-system --xattrs -cf - .) | tar --one-file-system --xattrs -tvf -)
[result: All mounted filesystems are copied over] Drat!


I think you have a typo somewhere. The --one-file-system option should
keep tar from traversing mount points (and your -tvf option isn't
going to copy anything...)



The only other possibility that comes to my mind is to mount the root drive
to /mnt/root read-only. mount the new drive to /mnt/new, and then tar-copy
but this may have consequences with the currently mounted root filesystem?


If your drives are identical you can boot the install media with 'linux
rescue' at the boot prompt, then use dd to copy the raw disk image.


cp -a or rsync should work as well as tar for a file oriented copy, and
both have --one-file-system options.


--
Les Mikesell
lesmikesell@gmail.com


--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 01-18-2008, 06:03 AM
Joachim Backes
 
Default Need help with tar or how to copy root to new drive?

Les Mikesell wrote:

Daniel B. Thurman wrote:

I am having a hard time simply trying to copy my root partition to a new
drive and somehow tar is not doing what I expected. Can someone advise
me how to do it correctly?

I tried:

1) mkdir /mnt/new
2) mount /dev/sdc3 /mnt/new
3) cd /mnt/new
4) (cd /; tar --one-file-system --xattrs -cf - .) | tar
--one-file-system --xattrs -tvf -)

[result: All mounted filesystems are copied over] Drat!


I think you have a typo somewhere. The --one-file-system option should
keep tar from traversing mount points (and your -tvf option isn't going
to copy anything...)


The only other possibility that comes to my mind is to mount the root
drive
to /mnt/root read-only. mount the new drive to /mnt/new, and then
tar-copy
but this may have consequences with the currently mounted root
filesystem?


If your drives are identical you can boot the install media with 'linux
rescue' at the boot prompt, then use dd to copy the raw disk image.


cp -a or rsync should work as well as tar for a file oriented copy, and
both have --one-file-system options.


Hi, I'm always using "cp -xaP " to some parition (omitting some directories in /) for making a copy
of the system, and the copied system is running even the copy is made during a fully running system.


Regards


--
Joachim Backes <joachim.backes@rhrk.uni-kl.de>
University of Kaiserslautern,Computer Center [RHRK],
Systems and Operations, High Performance Computing,
D-67653 Kaiserslautern, PO Box 3049, Germany
--------------------------------------------------
Phone: +49-631-205-2438, FAX: +49-631-205-3056
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 01-18-2008, 06:20 AM
"Daniel B. Thurman"
 
Default Need help with tar or how to copy root to new drive?

Les Mikesell wrote:
> Daniel B. Thurman wrote:
> > I am having a hard time simply trying to copy my root
> partition to a new
> > drive and somehow tar is not doing what I expected. Can
> someone advise
> > me how to do it correctly?
> >
> > I tried:
> >
> > 1) mkdir /mnt/new
> > 2) mount /dev/sdc3 /mnt/new
> > 3) cd /mnt/new
> > 4) (cd /; tar --one-file-system --xattrs -cf - .) | tar
> --one-file-system --xattrs -tvf -)
> > [result: All mounted filesystems are copied over] Drat!
>
> I think you have a typo somewhere. The --one-file-system
> option should
> keep tar from traversing mount points (and your -tvf option isn't
> going to copy anything...)
>
> > The only other possibility that comes to my mind is to
> mount the root drive
> > to /mnt/root read-only. mount the new drive to /mnt/new,
> and then tar-copy
> > but this may have consequences with the currently mounted
> root filesystem?
>
> If your drives are identical you can boot the install media
> with 'linux
> rescue' at the boot prompt, then use dd to copy the raw disk image.
>
> cp -a or rsync should work as well as tar for a file oriented
> copy, and
> both have --one-file-system options.
>

OK, I get it, it's me. I should have followed what I wrote above
and it would have worked but somehow I also wanted the mount directories
included but I guess I cannot have it both ways. Sigh.

What I was actually testing to get the mount directories only on
mounted filesystems was:

(cd /; tar --xattrs --one-file-system -cf - *) | tar -tvf -
--------------------------------------------^
and sure enough, the contents of the mounted filesystems were
included - which is not what I wanted.

BTW: Yes, the -tvf was intentional to show what I was gonna get
before committing the real action.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 01-18-2008, 03:20 PM
"Long, Gordon D."
 
Default Need help with tar or how to copy root to new drive?

Tar? Why not use find -xdev | cpio?

-----Original Message-----
From: fedora-list-bounces@redhat.com
[mailto:fedora-list-bounces@redhat.com] On Behalf Of Daniel B. Thurman
Sent: Friday, January 18, 2008 2:20 AM
To: For users of Fedora
Subject: RE: [F8] Need help with tar or how to copy root to new drive?

Les Mikesell wrote:
> Daniel B. Thurman wrote:
> > I am having a hard time simply trying to copy my root
> partition to a new
> > drive and somehow tar is not doing what I expected. Can
> someone advise
> > me how to do it correctly?
> >
> > I tried:
> >
> > 1) mkdir /mnt/new
> > 2) mount /dev/sdc3 /mnt/new
> > 3) cd /mnt/new
> > 4) (cd /; tar --one-file-system --xattrs -cf - .) | tar
> --one-file-system --xattrs -tvf -)
> > [result: All mounted filesystems are copied over] Drat!
>
> I think you have a typo somewhere. The --one-file-system
> option should
> keep tar from traversing mount points (and your -tvf option isn't
> going to copy anything...)
>
> > The only other possibility that comes to my mind is to
> mount the root drive
> > to /mnt/root read-only. mount the new drive to /mnt/new,
> and then tar-copy
> > but this may have consequences with the currently mounted
> root filesystem?
>
> If your drives are identical you can boot the install media
> with 'linux
> rescue' at the boot prompt, then use dd to copy the raw disk image.
>
> cp -a or rsync should work as well as tar for a file oriented
> copy, and
> both have --one-file-system options.
>

OK, I get it, it's me. I should have followed what I wrote above
and it would have worked but somehow I also wanted the mount
directories
included but I guess I cannot have it both ways. Sigh.

What I was actually testing to get the mount directories only on
mounted filesystems was:

(cd /; tar --xattrs --one-file-system -cf - *) | tar -tvf -
--------------------------------------------^
and sure enough, the contents of the mounted filesystems were
included - which is not what I wanted.

BTW: Yes, the -tvf was intentional to show what I was gonna get
before committing the real action.

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 01-18-2008, 04:12 PM
"Garry Williams"
 
Default Need help with tar or how to copy root to new drive?

On Jan 18, 2008 12:06 AM, Daniel B. Thurman <dant@cdkkt.com> wrote:
> 1) mkdir /mnt/new
> 2) mount /dev/sdc3 /mnt/new
> 3) cd /mnt/new
> 4) (cd /; tar --one-file-system --xattrs -cf - .) | tar --one-file-system --xattrs -tvf -)

Hmmm. Let me remove the "noise":

...
cd /mnt/new
...
cd /

--
Garry Williams +1 678 656-4579

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 
Old 01-21-2008, 01:57 PM
"Styma, Robert E (Robert)"
 
Default Need help with tar or how to copy root to new drive?

>
> [2nd try: Seems that my outgoing email is not reaching fedora-list...]
>
> I am having a hard time simply trying to copy my root
> partition to a new
> drive and somehow tar is not doing what I expected. Can someone advise
> me how to do it correctly?
>
> I tried:
>
> 1) mkdir /mnt/new
> 2) mount /dev/sdc3 /mnt/new
> 3) cd /mnt/new
> 4) (cd /; tar --one-file-system --xattrs -cf - .) | tar
> --one-file-system --xattrs -tvf -)
> [result: All mounted filesystems are copied over] Drat!
>
> The only other possibility that comes to my mind is to mount
> the root drive
> to /mnt/root read-only. mount the new drive to /mnt/new, and
> then tar-copy
> but this may have consequences with the currently mounted
> root filesystem?
>
I have accomplished this by getting the Linux system rescue cd
http://www.sysresccd.org/
and then using gparted to copy to the new drive. I then have
to use grub or grub_install
I believe the grub commands would be
root (hd0,0) # where hd0 is the drive specification for the new drive
and 0 is the boot partition. Remember grub calls
partition
1 partition 0.
setup (hd0) # where hd0 is replaced by the specification for the new
drive.
This will install grub on the MBR for that drive.
Note that it has been a while since I did this and I do not have a
machine
set up to do a quick check right now. So, I advise you double check in
the manual:
http://www.gnu.org/software/grub/manual/grub.html

Bob S.
Phoenix, AZ USA

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
 

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