Re: [expert] How do I copy a partition?

2001-04-28 Thread Todd Lyons

John Wolford wrote:

 2. copy:
 # cp -a /usr /mnt

Very good procedure.  As an adder, I would like to highlight that the
gentleman you were responding to mentioned the need for the -ax option. 
x keeps it within the same file system.

For those that don't know what this means, suppose you have /usr as
/dev/hda7 and /usr/local/dev/hda8.  You want to move /usr to /dev/hda9. 
So you mount /dev/hda9 to /mnt/usr and begin the copy command.  If you
specify -x, you will copy all of /usr EXCEPT /usr/local/*.  This may not
be a big deal for some people, but on my personal system /usr/local is
2x the size of /usr by itself.
-- 
tlyons at mandrakesoft dot com
http://www.linux-mandrake.com/en




Re: [expert] How do I copy a partition?

2001-04-28 Thread John Wolford

Thanks, Todd :-)

j



--- Todd Lyons [EMAIL PROTECTED] wrote:
 John Wolford wrote:
 
  2. copy:
  # cp -a /usr /mnt
 
 Very good procedure.  As an adder, I would like to highlight that the
 gentleman you were responding to mentioned the need for the -ax option. 
 x keeps it within the same file system.
 
 For those that don't know what this means, suppose you have /usr as
 /dev/hda7 and /usr/local/dev/hda8.  You want to move /usr to /dev/hda9. 
 So you mount /dev/hda9 to /mnt/usr and begin the copy command.  If you
 specify -x, you will copy all of /usr EXCEPT /usr/local/*.  This may not
 be a big deal for some people, but on my personal system /usr/local is
 2x the size of /usr by itself.
 -- 
 tlyons at mandrakesoft dot com
 http://www.linux-mandrake.com/en
 


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/




Re: [expert] How do I copy a partition?

2001-04-26 Thread Rial Juan


Check out the manpage on 'cpio'

We use the '-pumdv' options over here (had to copy files in a partition
myself the other day).

On 2001.04.17 09:39 Phil wrote:
 Hello all,
 
 I originally made my / partition too large (only 2% is used) and now I
 want 
 to shrink it because the /usr partition is full. My plan is to save the
 / 
 partition, delete the partition and then create a new one. I have already
 
 saved the /usr directories.
 
 The question is, how do I copy just the contents of the partition without
 
 copying the entire Linux disk (cp -a would copy the entire disk)?
 
 -- 
 Regards,
 Phil
 [EMAIL PROTECTED]
 
 
-- 
Rial Juanhttp://nighty.ulyssis.org
e-mail:  [EMAIL PROTECTED]
   ICQ:20135549
Belgiumtel:++3289856533
  cellular:   ++32496737018
ulyssis system admininstrator   http://www.ulyssis.org

1010011010 : Binary of the Beast




Re: [expert] How do I copy a partition?

2001-04-26 Thread ninjaz

My favorite method of copying partitions on systems on Linux is cp -ax
(the -x switch tells cp to stay on the current filesystem)

Eg.,

with / mounted as /, and the new one mounted as /newroot, you can say:

cd /
cp -ax . newroot

Make sure to tell lilo and fstab about the change, of course.

Also, you may want to look into GNU parted:

http://www.gnu.org/software/parted/parted.html

It can resize ext2 partitions, as long as the start of the partition stays
fixed (so in your case, it would work for / , but you would need to
handle /usr another way (if you want to change the size of /usr to fill
what / had before, anyway)


-pete

On Tue, 17 Apr 2001, Phil wrote:

 Hello all,
 
 I originally made my / partition too large (only 2% is used) and now I want 
 to shrink it because the /usr partition is full. My plan is to save the / 
 partition, delete the partition and then create a new one. I have already 
 saved the /usr directories.
 
 The question is, how do I copy just the contents of the partition without 
 copying the entire Linux disk (cp -a would copy the entire disk)?
 
 -- 
 Regards,
 Phil
 [EMAIL PROTECTED]
 





Re: [expert] How do I copy a partition?

2001-04-26 Thread John Wolford

Here's a old post that i've wound up re-posting a few times, and here i go again. I'm 
glad i saved
it!

Date: Thu, 25 Jan 2001 14:07:23 -0800 (PST) 
From: John Wolford [EMAIL PROTECTED]   
Subject: Summary: How to move /usr to another partition 
To: [EMAIL PROTECTED] 
 
Greetings again,

Thanks for all the replies re: How to move /usr to another partition? 
It's nice to know that what
i was working with SHOULD have worked, on principle. Here is a brief 
summary of the How to move
/usr to another partition? thread.

1. Resize partition, using Partition Magic or some such thing. [this 
will only work if you
actually have the appropriate space on the drive, of course]

All of the following assume that /usr will be duplicated somehow onto 
/mnt/usr temporarily, then
/etc/fstab will be updated to reflect the new location, reboot and 
presto, you are mounting the
new /usr.

2. copy:
# cp -a /usr /mnt

3. tarball:
# tar cvf /mnt/usr.tar /usr
# cd /mnt
# tar xvfp usr.tar
(Note that this method requires enough free space to hold not just 
mnt/usr but also /mnt/usr.tar)

   or
# tar cf - /usr | ( cd /mnt ; tar xvfp - )
   or
# cd /mnt
# tar cf - -C /usr | tar xvpf
(Note that these last two methods of tarballing only require enough 
free space to hold /usr)

Care must be taken to preserve relative links and file permissions if 
either 2 or 3 is to work.
Soft links do not support spanning partitions or devices and will cause 
failures if this occurs.


An aside: at the time that i was attempting this i was installing and 
re-installing on various
drives on the same system. It MAY have been the case that i had a swap 
partition on the device
that contained /usr and the device that contained the new /mnt/usr. If 
this were true, it could
have caused some problems, i don't know.


Thanks again,
John

--- [EMAIL PROTECTED] wrote:
 My favorite method of copying partitions on systems on Linux is cp -ax
 (the -x switch tells cp to stay on the current filesystem)
 
 Eg.,
 
 with / mounted as /, and the new one mounted as /newroot, you can say:
 
 cd /
 cp -ax . newroot
 
 Make sure to tell lilo and fstab about the change, of course.
 
 Also, you may want to look into GNU parted:
 
 http://www.gnu.org/software/parted/parted.html
 
 It can resize ext2 partitions, as long as the start of the partition stays
 fixed (so in your case, it would work for / , but you would need to
 handle /usr another way (if you want to change the size of /usr to fill
 what / had before, anyway)
 
 
   -pete


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/




RE: [expert] How do I copy a partition?

2001-04-19 Thread Jose M. Sanchez



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Darek KUZARA
Sent: Wednesday, April 18, 2001 3:06 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Re: [expert] How do I copy a partition?



A far simpler way is to CAT the drive...

I.E.

# cat /dev/hdb3  /dev/hdc3

-JMS
---

 The question is, how do I copy just the contents of the partition without
 copying the entire Linux disk (cp -a would copy the entire disk)?

I would suggest dump (look man dump, man restore). e.g.:

/usr/sbin/ufsdump 0ucf /some_dir/target_file /dev/hda5

-- /dev/hda5 - your root file system device
-- /some_dir/target_file  a backup file.

I hope this helps. Dump prevents links and all necessary privileges. I would
avoid using cp command.

I hope this helps

Darek





RE[2]: [expert] How do I copy a partition?

2001-04-19 Thread Rusty Carruth

"Jose M. Sanchez" [EMAIL PROTECTED] wrote:
 
 
 A far simpler way is to CAT the drive...
 
 I.E.
 
 # cat /dev/hdb3  /dev/hdc3
 
 -JMS
 ---

Well, this is fine if the partitions are the same size, but I
believe the question was when changing sizes...

Also, dd is possibly better than cat, as you can pick up from
where you left off if you want ;-)

rc


Rusty Carruth  Email: [EMAIL PROTECTED] or [EMAIL PROTECTED]
Voice: (480) 345-3621  SnailMail: Schlumberger ATE
FAX:   (480) 345-8793 7855 S. River Parkway, Suite 116
Ham: N7IKQ @ 146.82+,pl 162.2 Tempe, AZ 85284-1825
ICBM: 33 20' 44"N   111 53' 47"W




Re: RE[2]: [expert] How do I copy a partition?

2001-04-19 Thread John Wolford

I've tried to post this message already, did it make it? The delivery of my messages, 
both to and
from this list, seems suspect at best. And from the error messages that i do get to 
see, it looks
like the problem is on "mandrax"'s sideAnyway, here's a post that i made awhile 
ago on this
topic, after asking a similar question and getting many responses.


Date: Thu, 25 Jan 2001 14:07:23 -0800 (PST) 
From: John Wolford [EMAIL PROTECTED]  
Subject: Summary: How to move /usr to another partition 
To: [EMAIL PROTECTED] 
 
 


Greetings again,

Thanks for all the replies re: How to move /usr to another partition? 
It's nice to know that what
i was working with SHOULD have worked, on principle. Here is a brief 
summary of the "How to move
/usr to another partition?" thread.

1. Resize partition, using Partition Magic or some such thing. [this 
will only work if you
actually have the appropriate space on the drive, of course]

All of the following assume that /usr will be duplicated somehow onto 
/mnt/usr temporarily, then
/etc/fstab will be updated to reflect the new location, reboot and 
presto, you are mounting the
new /usr.

2. copy:
# cp -a /usr /mnt

3. tarball:
# tar cvf /mnt/usr.tar /usr
# cd /mnt
# tar xvfp usr.tar
(Note that this method requires enough free space to hold not just 
mnt/usr but also /mnt/usr.tar)

   or
# tar cf - /usr | ( cd /mnt ; tar xvfp - )
   or
# cd /mnt
# tar cf - -C /usr | tar xvpf
(Note that these last two methods of tarballing only require enough 
free space to hold /usr)

Care must be taken to preserve relative links and file permissions if 
either 2 or 3 is to work.
Soft links do not support spanning partitions or devices and will cause 
failures if this occurs.


An aside: at the time that i was attempting this i was installing and 
re-installing on various
drives on the same system. It MAY have been the case that i had a swap 
partition on the device
that contained /usr and the device that contained the new /mnt/usr. If 
this were true, it could
have caused some problems, i don't know.


Thanks again,
John





__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/




Re: [expert] How do I copy a partition?

2001-04-18 Thread Darek KUZARA


 I originally made my "/" partition too large (only 2% is used) and now I want
 to shrink it because the /usr partition is full. My plan is to save the "/"
 partition, delete the partition and then create a new one. I have already
 saved the /usr directories.

You may avoid all the hassle with the re-partitioning by moving any big
directory from /usr to / and making symbolic link to it. This is the fastest
workaround for your problem, e.g.

# mv /usr/big_dir /
# ln -s /big_dir /usr/big_dir

In this case no further changes will be needed (i.e. resetting PATHs for
installed software etc.)

 The question is, how do I copy just the contents of the partition without
 copying the entire Linux disk (cp -a would copy the entire disk)?

I would suggest dump (look man dump, man restore). e.g.:

/usr/sbin/ufsdump 0ucf /some_dir/target_file /dev/hda5

-- /dev/hda5 - your root file system device
-- /some_dir/target_file  a backup file.

I hope this helps. Dump prevents links and all necessary privileges. I would
avoid using cp command. 

I hope this helps

Darek




[expert] How do I copy a partition?

2001-04-17 Thread Phil

Hello all,

I originally made my "/" partition too large (only 2% is used) and now I want 
to shrink it because the /usr partition is full. My plan is to save the "/" 
partition, delete the partition and then create a new one. I have already 
saved the /usr directories.

The question is, how do I copy just the contents of the partition without 
copying the entire Linux disk (cp -a would copy the entire disk)?

-- 
Regards,
Phil
[EMAIL PROTECTED]