Find the answer to your Linux question:
Results 1 to 4 of 4
Hi All, Now I have learned creating partition in linux (ubuntu) terminal, well that's an achievement for a newbie. The next thing that I want to know is, how can ...
  1. #1
    Just Joined!
    Join Date
    Dec 2010
    Posts
    6

    How to copy files from a partition to another

    Hi All,

    Now I have learned creating partition in linux (ubuntu) terminal, well that's an achievement for a newbie.

    The next thing that I want to know is, how can I copy the contents of a partition to another partition. Like if I want to backup its content to a new partition that Im going to create.


    Any ideas please. And Thank you

  2. #2
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,099
    Not sure exactly what it is you are wanting to do, but you can use the cp command for simple copying of files.

    Depending on your needs, you can use the dd command for such tasks.

    I personally like using FSArchiver for creating archives of partitions which can be restored later to the same partition, or to a partition on another drive.

    Note that cp, dd, and fsarchiver are command line tools.

    For options on using cp and dd check the manual page in a terminal:

    Code:
    man cp
    Code:
    man dd
    FSArchiver has its own website:

    FSArchiver


    Edit: for more on using the command line under Linux, check out linuxcommand.org:

    LinuxCommand.org: Learn the Linux command line
    Last edited by oz; 12-10-2010 at 03:36 PM.
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

  3. #3
    Just Joined!
    Join Date
    Dec 2010
    Posts
    6
    Thank you for the reply ozar, that helped me.

    I was just thinking if this scenario is possible:

    I have an existing partition sdb1 and I created a new partition sdb2, then copied the contents of sdb1 to sdb2. Then I deleted my sdb1 partition. Now I want my sdb2 to act as my previous sdb1 that I have deleted so that I could mount it again from the previous directory where the old sdb1 is mounted and use all the copied files or maybe also applications from the previous deleted partition; and also renaming sdb2 to sdb1?

    Basically the contents of sdb2 will be a total replication of what sdb1 have before, but might have a difference in size. Example: old sdb1 is 10GB, then sdb2 is 8GB. So if you could notice, sdb1 is a copy of sdb2 that is being Shrinked in size


    Any ideas from all the members here if this is possible? And if yes how can this be achieved?

    For some reason I preferred using native scripts of linux, like fdisk, cp, etc and not
    using other apps to achieve this.


    THank you very much

  4. #4
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,099
    When moving/creating/deleting partitions, you might need to consider any updates that need to be made to your fstab and bootloader configuration files, depending on how you've named your partitions.
    oz

    new members/users: read this first | new member faq
    no private messages requesting computer support - post them on the forums!
    please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...