Copying partitions in terminal mode

Wolf Canis mr_canis at yahoo.co.uk
Tue Dec 18 20:17:52 UTC 2007


Hello elmo,
I would suggest, that you use find and cpio.
1) both partitions have to be mounted
2) Assuming that /dev/sda7 is your root directory and /dev/sdc5 is mounted
    on /mnt:
    find >AllYourTopLevelDirsUnderRoot< | cpio -pdv /mnt

    For example:
       find /bin /sbin /usr /home /var /etc /boot | cpio -pdv /mnt

Hope that helps.


elmo wrote:
> Is it practical to use terminal mode to copy an entire ubuntu partition 
> to an external hard drive for backup purposes?
>
> I haven't done much with terminal commands except for the simplest ones 
> so I'm not comfortable with copying an
> entire partition.   I have copied a file or two within a partition but 
> copying an entire partition seems like a big job.
>
> After digging around in my notes, a book or two, and some websites, I 
> came up with this command:
>       cp -aprv  /dev/sda7   /dev/sdc5   
>
> sda7 is where ubuntu is currently installed  and  sdc5 is the target, an 
> empty  ext3 formatted
> partition on the external hard drive.
>
> The command seems to be too simple to do a complete partition copy.
>
> Which way is the better way to run this kind of command,. from an 
> installed ubuntu or from
> a ubuntu CD?
>
> elmo
>
>
>
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20071218/88d5d2c0/attachment.sig>


More information about the ubuntu-users mailing list