LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   move partition with directory & contents to another drive. (http://www.linuxquestions.org/questions/linux-newbie-8/move-partition-with-directory-and-contents-to-another-drive-899655/)

EDDY1 08-26-2011 01:23 PM

move partition with directory & contents to another drive.
 
I have a partition sda10 which is named /home partimage, it resides within my Debian logical partition, but is not added to my fstab as I prefer not to automount after login.
It's approximately taking up 400G space on my Debian hdd sda & I would like to move to sdb windows drive which has 750G unallocated space also without automounting.
Would it be easier to just create the partition & just move the directory to it?

chickenjoy 08-26-2011 01:39 PM

wouldn't the following work:

Code:

dd if=/dev/sda10 of=/dev/sdbX

EDDY1 08-26-2011 01:51 PM

Thank you for your response, I usually use clonezilla, never used the command line to do it.
So my question is can I take it out of logical & create & place on a primary partition.
Also does this command create the partition or does it need to be created prior to the dd command you supplied?

chrism01 08-28-2011 08:10 PM

Quote:

Would it be easier to just create the partition & just move the directory to it?
This sounds ok to me, especially if you want to retain Linux perms etc (I assume you mean an ext3 or ext4 partition).
Create the new partition, mount it, mv the old dir to a new name eg /home2 on new partition, rename old to /home3, rename new to /home and reboot/test.
If ok, delete old one...

EDDY1 08-28-2011 10:12 PM

Would this command work, or do I need to add to the command?
Quote:

mv /home/partimage sdb2
or would the command that chickenjoy gave be better.

EDDY1 08-29-2011 12:13 AM

Have the device names changed in the commands on this howto dated from 2005
http://www.linuxquestions.org/questi...ommand-362506/
Or are the commands upto date

EDDY1 08-29-2011 02:40 AM

I've created a partition on sdb3 & am going to copy everything fro sda10 to sdb3 they are all image files I will just copy individual folders .


All times are GMT -5. The time now is 08:20 AM.