You are not logged in.

#1 2010-08-03 16:15:42

Sc9
Member
Registered: 2010-08-03
Posts: 2

[solved] Moving data between partitions

Hi,

I currently have separate /boot, swap, / and /home partitions. I'd like to no longer have a separate /home partition so I can use the fourth partition for Windows, but I'm not sure on all the steps of how to do this. What I'm planning is (using a livecd)

Move everything in sda4 to sda3/home, then remove the line for the /home partition from /etc/fstab.

I'm not sure how to go about moving everything between the partitions though. (~11G in /home, and plenty of space in the / partition). Will mv * do the job, or will hidden files etc be missed? Also, will this maintain permissions etc?

Thanks for any help.

Last edited by Sc9 (2010-08-03 18:00:53)

Offline

#2 2010-08-03 16:20:00

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: [solved] Moving data between partitions

You can boot the live CD, mount both partitions, and copy date between the two. You're simply copying the entire home directory to the root directory:

# cp -r /path/to/home /path/to/root

Example:

# cp -r /mnt/home /mnt/root

Offline

#3 2010-08-03 16:24:30

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [solved] Moving data between partitions

itsbrad212 wrote:

You can boot the live CD, mount both partitions, and copy date between the two. You're simply copying the entire home directory to the root directory:

# cp -r /path/to/home /path/to/root

Example:

# cp -r /mnt/home /mnt/root

What about symlinks? :-)

Offline

#4 2010-08-03 16:40:41

diegonc
Member
Registered: 2008-12-13
Posts: 42

Re: [solved] Moving data between partitions

I've seen somebody pass the -a switch to cp so it copies also the file's attributes.

I'd like to no longer have a separate /home partition so *I can use the fourth partition for Windows*

symlinks don't look like a good idea tongue

Offline

#5 2010-08-03 17:42:01

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: [solved] Moving data between partitions

I would still keep / and /home separate, but you could create the whole Linux install in an extended partition.

Although, going through all that might be a hassle, since linux is already installed and it would involve changing a lot of partitions and any mis-step could be disastrous.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2010-08-03 18:01:45

Sc9
Member
Registered: 2010-08-03
Posts: 2

Re: [solved] Moving data between partitions

Thanks, used cp -a and it worked.

Yeah, I'd ideally like them separate on an extended partition, but didn't fancy too much messing around.

Offline

#7 2010-08-03 18:06:04

jamesbond007
Member
From: Germany
Registered: 2009-06-14
Posts: 150

Re: [solved] Moving data between partitions

Hi Sc9,

I guess I would use rsync to copy the home directory. Collecting the desired options from the manpage can be quite time-consuming, but a Google search will quickly reveal some working examples for your use case.

Kind regards,
jamesbond007.

Offline

Board footer

Powered by FluxBB