A way to transfer drives?
I'm looking for a way to upgrade my HD and maintain file/directory structure.
I've got a 20GB with partitions for / /home /usr how can I copy/clone this drive over to it's 60B replacement? Thanks!
Darryl
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Connect the new drive in place as the secondary.
Boot as normal.
Use fdisk as appropriate on the new drive to set up your partitions as you want them.
Create file systems on the partitions you have created using whatever file system you are using (eg Ext3). This does not have to be the same as the previous FS you used.
To copy from one place to another (including sub-dirs) you can use find and cpio like this:
cd <wherever you are copying _from_
find . -print | cpio -pmudv <wherever you want to put the files>
eg:
cd /usr
find . -print | cpio -pmudv /mnt/newusr
To do root, you can use grep in between the commands:
cd /
find . -print | grep -v newdisk | cpio -pmudv /mnt/newdisk
Paul.
Quoted 11 lines · On Thu, 2002-10-31 at 13:53, 1stFlight wrote:
I'm looking for a way to upgrade my HD and maintain file/directory structure.
I've got a 20GB with partitions for / /home /usr how can I copy/clone this drive over to it's 60B replacement? Thanks!Darryl
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Signature · 11 lines
Paul Furness Systems Manager Steepness is an illusion caused by flat things leaning over. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Excuse the confusion, I wasn't thinking straight. In my examples below, the < and > are not intended to be used in the command - I just meant to highlight the source / destination descriptions.
Quoted 55 lines · Paul Furness
Connect the new drive in place as the secondary.
Boot as normal.
Use fdisk as appropriate on the new drive to set up your partitions as you want them.
Create file systems on the partitions you have created using whatever file system you are using (eg Ext3). This does not have to be the same as the previous FS you used.To copy from one place to another (including sub-dirs) you can use find and cpio like this:
cd <wherever you are copying _from_
find . -print | cpio -pmudv <wherever you want to put the files>eg:
cd /usr
find . -print | cpio -pmudv/mnt/newusrTo do root, you can use grep in between the commands:
cd /
find . -print | grep -v newdisk | cpio -pmudv/mnt/newdiskPaul.
Quoted 11 lines · On Thu, 2002-10-31 at 13:53, 1stFlight wrote:
I'm looking for a way to upgrade my HD and maintain file/directory structure.
I've got a 20GB with partitions for / /home /usr how can I copy/clone this drive over to it's 60B replacement? Thanks!Darryl
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqsSignature · 11 lines
Paul Furness Systems Manager Steepness is an illusion caused by flat things leaning over. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Signature · 11 lines
Paul Furness Systems Manager Steepness is an illusion caused by flat things leaning over. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Quoted 2 lines · 1stFlight wrote:
I'm looking for a way to upgrade my HD and maintain file/directory structure.
I've got a 20GB with partitions for / /home /usr how can I copy/clone this drive over to it's 60B replacement? Thanks!
Hi
just finished this operation last night .
setup :
boot from /dev/hda
/dev/hdb - 40GB (old disk)/dev/hdc - 60GB (new disk )
# dd if=/dev/hdb of=/dev/hdc bs=2M
it did a perfect,bit by bit, clone . then, i used cfdisk to set up an additional 20Gb partition for the extra space.
works like a charm .
i always set bs (block size) close to the size of the HDD buffer (2048 in my case)
hope it helps.
dragos
Signature · 12 lines
| Dragos LUNGU | | http://www.xts.ro | [email protected] | mobile (+40)745 379 734 | office (+40)251 190 561 - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
This does, however, have the disadvantage that your existing partitions are copied but not resized. Eventually, you end up with lots of little partitions (after a couple of hard disk upgrades...)
P.
Quoted 46 lines · Dragos LUNGU
Quoted 3 lines · 1stFlight wrote:
I'm looking for a way to upgrade my HD and maintain file/directory structure.
I've got a 20GB with partitions for / /home /usr how can I copy/clone this drive over to it's 60B replacement? Thanks!Hi
just finished this operation last night .
setup :boot from
/dev/hda
/dev/hdb- 40GB (old disk)/dev/hdc- 60GB (new disk )# dd if=/dev/hdb of=/dev/hdc bs=2Mit did a perfect,bit by bit, clone . then, i used cfdisk to set up an additional 20Gb partition for the extra space.
works like a charm .
i always set bs (block size) close to the size of the HDD buffer (2048 in my case)
hope it helps.
dragos
Signature · 12 lines
| Dragos LUNGU | | http://www.xts.ro | [email protected] | mobile (+40)745 379 734 | office (+40)251 190 561 - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Signature · 11 lines
Paul Furness Systems Manager Steepness is an illusion caused by flat things leaning over. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Quoted 3 lines · Paul Furness
This does, however, have the disadvantage that your existing partitions are copied but not resized. Eventually, you end up with lots of little partitions (after a couple of hard disk upgrades...)
you are absolutely right. I allready lost the old 256 MB swap partition. (unsable space). I never do this twice.
Signature · 12 lines
| Dragos LUNGU | | http://www.xts.ro | [email protected] | mobile (+40)745 379 734 | office (+40)251 190 561 - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Quoted 5 lines · On Thu, 31 Oct 2002, 1stFlight wrote:
I'm looking for a way to upgrade my HD and maintain file/directory structure.
I've got a 20GB with partitions for / /home /usr how can I copy/clone this drive over to it's 60B replacement? Thanks!Darryl
I wouldn't copy/clone it, I'd make new partitions in proportion, mount them on new temporary mount points (make some with mkdir if you don't have some handy) and use tartar to copy the filesystems:
tartar / /newslash
tartar /home /newhome
.....
tartar is what I call it, I chose the tar options for just such a use
#!/bin/bash
##copy a directory or partition
tar -C "$1" -cOl . | tar -C "$2" -xpf -
You could use cpio or cp or what you like instead, that is just the way I would do it.
Some time ago somebody wondered why this did not copy everything in / - it's not meant to,
Don't forget to reinstall lilo or whatever bootloader you use after you get the new hd mounted where it is going to go. have a boot floppy handy. You can install lilo in one place to make it work in another, but I'm not up to explaining how.
--
---oops---
#!/bin/bash
##copy a directory or partition
tar -C "$1" -cOl . | tar -C "$2" -xpf -
Am Freitag, 1. November 2002 01:30 schrieb [email protected]:
Quoted 15 lines · On Thu, 31 Oct 2002, 1stFlight wrote:
Quoted 5 lines
I'm looking for a way to upgrade my HD and maintain file/directory
structure. I've got a 20GB with partitions for / /home /usr how can I copy/clone this drive over to it's 60B replacement? Thanks!Darryl
I wouldn't copy/clone it, I'd make new partitions in proportion, mount them on new temporary mount points (make some with mkdir if you don't have some handy) and use tartar to copy the filesystems:
tartar / /newslash
tartar /home /newhome
.....
Quoted 6 lines
tartar is what I call it, I chose the tar options for just such a use
#!/bin/bash
##copy a directory or partition
tar -C "$1" -cOl . | tar -C "$2" -xpf -
That's an idea, but I believe parted should be much faster. I think compressing and decompressing would be a little bit slow ?
Regarding,
Michael
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Quoted 8 lines · Michael Scondo
Quoted 4 lines
#!/bin/bash
##copy a directory or partition
tar -C "$1" -cOl . | tar -C "$2" -xpf -That's an idea, but I believe parted should be much faster. I think compressing and decompressing would be a little bit slow ?
It's not compressing and decompressing. Tar only does that if you tell it (with an option I,y,z,Z or the corresponding long names or --use-compress-program). Saving and restoring this way will also defragment the filesystem.
Quoted 3 lines
Regarding,
Michael
-
--
---oops---
________________________________________________________________
Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!
Visit www.juno.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
There is only one snag with tartar: it doesn't pick up 'dot' files in the starting directory.
Quoted 33 lines · On Sun, 2002-11-03 at 00:57, [email protected] wrote:
Quoted 8 lines · Michael Scondo
Quoted 4 lines
#!/bin/bash
##copy a directory or partition
tar -C "$1" -cOl . | tar -C "$2" -xpf -That's an idea, but I believe parted should be much faster. I think compressing and decompressing would be a little bit slow ?
It's not compressing and decompressing. Tar only does that if you tell it (with an option I,y,z,Z or the corresponding long names or --use-compress-program). Saving and restoring this way will also defragment the filesystem.
Quoted 3 lines
Regarding,
Michael
---
---oops---________________________________________________________________
Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!
Visit www.juno.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Signature · 11 lines
Paul Furness Systems Manager Steepness is an illusion caused by flat things leaning over. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs
Quoted 2 lines · Paul Furness
There is only one snag with tartar: it doesn't pick up 'dot' files in the starting directory.
If you mean files of the form .name, I can't see that it doesn't. ls won't show them without -a though.
Lawson
---oops---
________________________________________________________________
Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!
Visit www.juno.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
My apologies, you are correct. I think my brain stepped out for a moment... :)
To be exact: if you tar using a directory name, it works fine, but if you use a wild card it doesn't see dot files (because that's how wildcard expansion works).
thus:
cd $HOME
tar -cvf /archive/homedir.tar *
will not do the same as:
cd $HOME
tar -cvf /archive/homedir.tar .
The first example will not save anything who's name begins with a dot, but the second one will.
A thing to know about:
cd /
tar -cvf /archive/homedir.tar $HOME
will store the full path of everything in your home dir. This means that if you try and extract it later on, it will try and put all the files back _exactly_ where they came from in the first place.
Although this sounds like a fine idea for a backup, I have found that it makes more sense to avoid the full paths for user generated data, because there will always be the time when you want to get back the backup and compare it to what you already have - which is much more complicated if you have the full paths stored in the archive.
It also means that restoring the stuff to a different machine is harder, because you need an identical directory structure - less of a problem with a home dir, but it could be something more complicated like this:
tar -cvf /archive/backup.tar /usr/local/data/bungle/source/c/big_project
Paul.
Quoted 23 lines · On Mon, 2002-11-04 at 21:37, [email protected] wrote:
Quoted 2 lines · Paul Furness
There is only one snag with tartar: it doesn't pick up 'dot' files in the starting directory.
If you mean files of the form .name, I can't see that it doesn't. ls won't show them without -a though.
Lawson
---oops---________________________________________________________________
Sign Up for Juno Platinum Internet Access Today
Only $9.95 per month!
Visit www.juno.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Signature · 11 lines
Paul Furness Systems Manager Steepness is an illusion caused by flat things leaning over. - To unsubscribe from this list: send the line "unsubscribe linux-newbie" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.linux-learn.org/faqs