LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can I safely copy one partition to another and delete the first? (https://www.linuxquestions.org/questions/linux-newbie-8/can-i-safely-copy-one-partition-to-another-and-delete-the-first-652196/)

Excalibre 06-27-2008 11:10 PM

Can I safely copy one partition to another and delete the first?
 
I'm screwing around with my partitioning scheme in order to make room to try some other distros and I'm wondering how to copy my / partition to elsewhere on the disk. I'm thinking just make two partitions the same size (and format, which is ext3), and then use the "dd" command, right? Or will that destroy my file system? Like, "dd if=/dev/sda5 of=/dev/sda3"? gparted will allow the user to move a partition but I've heard that it's buggy and not reliable.

lwasserm 06-28-2008 12:16 AM

I've used gparted several times to resize and copy partitions and never had an issue. (I always backup any first, but have never had to restore because of anything gparted has done). If you are creating a new partition on the same disk so another OS or distro can be installed, it may not be necessary to copy your existing partition, just shrink it to make room for another. A mounted partition cannot be moved or resized, and you can't umount the partition your OS is running on, so the easiest way is to boot from a live CD or rescue CD that has gparted on it.

Honeysuckle 06-28-2008 12:20 AM

Quote:

Originally Posted by Excalibre (Post 3197500)
gparted will allow the user to move a partition but I've heard that it's buggy and not reliable.

I think there is an inherent risk of data corruption whenever you move or copy data, but I've used gparted several times and never had an error. I moved all of the partitions on my laptop the other day, including 2 windows partitions. Although I anticipated problems (I was prepared to restore everything, if necessary), it did it without problem. If you have a backup, I think gparted is worth using.

Excalibre 06-28-2008 12:35 AM

Quote:

Originally Posted by lwasserm (Post 3197530)
I've used gparted several times to resize and copy partitions and never had an issue. (I always backup any first, but have never had to restore because of anything gparted has done). If you are creating a new partition on the same disk so another OS or distro can be installed, it may not be necessary to copy your existing partition, just shrink it to make room for another. A mounted partition cannot be moved or resized, and you can't umount the partition your OS is running on, so the easiest way is to boot from a live CD or rescue CD that has gparted on it.

Yeah, I would just resize if that were an option but it's really not; the partition is in a bad spot because I created it last week as a stopgap for various reasons but if I want my partition table to be at all reasonable I have to move and resize my / partition.

If it's safe to use gparted's move tool, though, I'll do that instead. I'm guessing from the responses here that it's not as risky as I was led to believe.


All times are GMT -5. The time now is 03:00 PM.