*SOLVED* Moving /home to new partition

On my desktop rig, I’m dual-booting Mint 15 & Windows Vista, with GRUB on the MBR of sda (Mint is on sdb, with a NTFS data partition also on the disc). Vista was first (many years prior), and I installed Mint in the summer to get round a problem with Steam (multiple users just doesn’t work on Windows). Anyway, as this was done quickly, I just went with one primary partition for Mint, mounting / only. I’m regretting this now, as Mint 15’s support will run out before Mint 17 LTS comes out. So, rather than run unsupported for 5 months, and in the spirit of “do it sooner rather than later”, I want to repartition the drive to add another primary partition, so that I can mount /home on it, thus allowing me to re-install without losing the /home partition (and the 20Gb of Steam downloads).

My question, is once I’ve done the easy part and repartitioned the drive, how do I move /home to the new partition? What is the procedure, other than using a liveCD to move the data then updating fstab?

Tiz all covered here:

Nice one, a few more steps than I thought but not overly complicated. Seems to suggest that it’s more easily done “live” rather than rebooting into a LiveCD… Not sure I’m too keen to work on it while it’s mounted, but the process is easy to follow so I’ll just trust it :slight_smile:

Got a side issue with disc capacity (as it’s a copy, rather than an in-place switch), as I’ll need double the disc space, and the disc is currently fully partitioned. Worse, my / partition will have 20Gb free on it after all is done, and shrinking it may not work (and, unless I can move the new /home partition, will leave a big unpartitioned hole in the drive)

OK, you’re loosing me here … where exactly do you want to move /home from an to ?

Something else that jumps out … why are you paranoid about running unsupported for 5 months, I certainly wouldn’t be … there will only be a couple of “security” fixes, and those are HIGHLY unlikely to have exploits in the wild.

I’d be more paranoid on a server, but not on a desktop … hell Mint doesn’t apply half the Ubuntu updates by default anyway, there was a big hoohaa about that recently with an Ubuntu dev stating Mint “isn’t safe for online banking” because of its update policy … but I’d still trust it MUCH more than Windows with the latest AV.

I’m not that paranoid about running unsupported (it’s really only the web browser, and I could always “backport” it myself from source), but I’ll have to do this when Mint 17 comes out anyway. At the moment, I just have my entire Mint install on 1 partition, but I want it on 2 (one for / and one for /home) to allow an in-place upgrade/install. But I need it in-place, as the entire disc is partitioned so there’s no space to make the copy.

I’m thinking about a backup/delete/restore - backup /home folder externally (maybe NTFS drive?), delete it & re-partition, then restore it onto the new partition & update fstab. Thoughts?

I’m still trying to understand your “hole in the middle of the drive” statement ??

How I see it …

you shrink your current Mint partition … create a new partition … rsync the contents of /home to the new new partition … adjust fstab to mount the new partition as /home … rename the old /home to /home-old … create a new /home mountpoint … sudo mount -a to mount the new partition as /home … check everything works … delete /home-old

Yeah, I get the process, but I don’t believe I’ll be able to shrink the Mint partition, as I’d need the same amount of free space as the /home currently occupies, not counting fragmentation. I don’t have it, the partition is pretty full, which isn’t normally a problem :frowning:

Edit: Also, I thought Mint drew from Ubuntu’s repos directly? I’ll have to have a look at my sources later!


do it twice … once to the external drive … then after adjusting the partitions, move it again to the freshly created partition.

Once you’ve rsynced it to the external HDD you effectively have a backup so you’d have to do sommat really dumb to not be able to recover :wink:

Or is that what you meant ?

I am always for the simplest solution. I would tackle it the opposite way:
From a Live CD:
Create a smaller root partition (say 20 gb)
Copy everything from the existing Mint partition (except /home folder) into the newly created partition.
Delete everything except the /home folder in the Mint partition
Move your folder to the root of the Mint partition then delete the /home directory.
In the newly created root partition create a /home folder
Edit the fstab to point to the correct partitions
Update grub and then reboot (and keep your fingers crossed) to your new setup

Yeah, that looks like what I was planning. Does rsync use some kind of shadow copy, or doesn’t it really matter that the partition is mounted (not like Windows, where there is constant I/O for no apparent reason)?

This is the bit I can’t do - can’t create something out of nothing. I have no unpartitioned space - I’d have to shrink the existing NTFS partition, create the new one, then at the end delete the old one and grow the NTFS back again. And I don’t trust NTFS that much.

I think I’ll end up backing up the /home folder, then wiping the entire partition, then installing Mint 17 into it, but this time re-partition the Linux partition into 2. Then restore the /home folder over the top of the new one on the seperate partition (using a LiveCD, so that it’s not in use). I guess there’s a risk of using a Mint 15 /home with Mint 17, but I guess I could just sync the Steam folder, as that’s the main worry…

I guess it can do something similar to “shadow copy” as it copied my home folder perfectly … and I had some stuff open.
(if that’s what you mean ?)

Obviosly you’d want to ommit the .gvfs folder if you have anything else mounted through it at the time … but that’s all in the Ubuntu tutorial, including how to compare the backup for differences :slight_smile:

Yeah, I think I’ve got it sorted in my head :slight_smile:

Thanks for marking it solved :slight_smile: