You are not logged in.

#1 2011-10-19 12:50:17

teachop
Member
Registered: 2011-10-19
Posts: 4

[SOLVED] Partitioning mix up, move /home and /boot

Below is my partition setup, not exactly what I intended.  Is it possible to get /home into the 184G partition (presently mounted as /boot)?  If so, how should I move /home safely, as the system is healthy and nice and I don't want to lose it?

$ df -h
Filesystem                                              Size  Used Avail Use% Mounted on
udev                                                     10M     0   10M   0% /dev
run                                                      10M  200K  9.9M   2% /run
/dev/disk/by-uuid/9533b496-ade4-448a-b699-0caaf3d71a09   19G  4.1G   14G  24% /
shm                                                     1.9G     0  1.9G   0% /dev/shm
tmpfs                                                   1.9G  8.0K  1.9G   1% /tmp
/dev/sda5                                               184G  203M  174G   1% /boot
$ cat /etc/fstab
# 
# /etc/fstab: static file system information
#
# <file system>	<dir>	<type>	<options>	<dump>	<pass>
tmpfs		/tmp	tmpfs	nodev,nosuid	0	0
UUID=9533b496-ade4-448a-b699-0caaf3d71a09 / ext4 defaults 0 1
UUID=d13f21a5-fd56-4ce6-b227-71998ede0c61 /boot ext4 defaults 0 1
UUID=d217dcef-6448-4cc9-b9dd-8cf3fc555dc6 swap swap defaults 0 0
$ 

Last edited by teachop (2011-10-22 11:35:36)

Offline

#2 2011-10-19 15:40:55

possiblefool
Member
From: UK
Registered: 2011-06-18
Posts: 29

Re: [SOLVED] Partitioning mix up, move /home and /boot

This post from last week should help with that.

Offline

#3 2011-10-19 16:11:18

teachop
Member
Registered: 2011-10-19
Posts: 4

Re: [SOLVED] Partitioning mix up, move /home and /boot

My thoughts from that thread are that it wasn't possible.  They gave up and redid the partitions, which I was hoping was avoidable.  Was hoping to be able to have the boot and home contents on the same partition, or whatever, by a simple copy and then edit of fstab.  I need to learn more obviously.

Offline

#4 2011-10-19 17:26:23

possiblefool
Member
From: UK
Registered: 2011-06-18
Posts: 29

Re: [SOLVED] Partitioning mix up, move /home and /boot

Apologies, I just remembered the previous post and saw it was marked as solved, so sent it your way, I didnt read through it properly clearly!
As you dont want to relocate the boot partition like the previous post did, I'd have thought you could just move your home folder to the boot partition and symlink to it from the point your system currently looks for it.

I'm fairly new to such matters so you may wanna wait for someone else to confirm this isnt a terrible idea, seems ok to me, but I stand by my user name.
If you're impatient and have a live cd to fix it if it doesnt work, just copy the folder across and rename the current home folder first to make sure it all works as expected.

Offline

#5 2011-10-19 18:18:09

teachop
Member
Registered: 2011-10-19
Posts: 4

Re: [SOLVED] Partitioning mix up, move /home and /boot

possiblefool wrote:

but I stand by my user name

Ha ha.  I appreciate the help.  I will sit tight for more input, the install is working great, just need to get this addressed before I run out of space.

Offline

#6 2011-10-19 19:24:42

possiblefool
Member
From: UK
Registered: 2011-06-18
Posts: 29

Re: [SOLVED] Partitioning mix up, move /home and /boot

No worries, reading that thread through properly, I have a feeling that it should work and the OP did something wrong, Im not sure reinstalling the kernel was required though.

If you want to move /boot as well then reading that link along with this one and this one (though in step 6 use "defaults 0 1" instead of "ro 0 0") should get you through it.

Otherwise symlinking will be less effort assuming it doesnt get slapped down smile

Offline

#7 2011-10-19 22:32:33

meph
Member
Registered: 2011-06-06
Posts: 160

Re: [SOLVED] Partitioning mix up, move /home and /boot

If I understand you correctly, you basically want to swap your /home and /boot because of a mistake you made during the installation? So /home would be on the big partition and everything else on the small one? (so /boot wouldn't have its own partition either and be on the small partition with the rest of / )

That should be quite possible. Obviously from a live CD, as you don't want any data to be in use when you move it. But other than that, it should be just a matter of moving data, and reconfiguring your fstab and bootloader. Everything else in the system uses the directory structure for navigation which should be intact, so as long as everything is correctly mounted it shouldn't care (or even know) that it's in a new place.

... unless I'm wrong tongue Never actually tried anything like this. If you actually do it, I would be very interested to know the result. Either way, good luck smile


edit: forget symlinks. It might work for now, but it might bite you in the rear later on. Besides, it's a workaround, not a solution wink

Last edited by meph (2011-10-19 22:34:16)


Running arch is like raising a puppy - if you spend a bit of time with it each day and do just a bit of training you'll end up with the most loyal partner you could want; if you lock it in a room and don't check on if for several days, it'll tear apart your stuff and poop everywhere.

Offline

#8 2011-10-19 23:18:45

SS4
Member
From: !Rochford, Essex
Registered: 2010-12-05
Posts: 699

Re: [SOLVED] Partitioning mix up, move /home and /boot

It would probably be easiest to give /home it's own partition by reducing the space for boot

Using a live CD (I suggest the gparted Live CD)


1.  Backup your data, preferably to an external source - better to be safe than sorry
2.  Shrink /boot to an appropriate size. 512mb is generous for /boot
3.  Create a new partition from the empty space
4.  Format the partition you just made to whichever filesystem you want (I shall be using ext4 in this case)
5.  Apply your changes
6.  Open a terminal and log in as root/use sudo
7. 

mkdir /mnt/root /mnt/newhome
mount /dev/disk/by-uuid/9533b496-ade4-448a-b699-0caaf3d71a09 /mnt/root
mount /dev/sda6 /mnt/home
cp -av /mnt/root/home/teachop/ /mnt/newhome
mv /mnt/root/home /mnt/root/old-home
blkid >> /mnt/root/etc/fstab

8.  Tidy up the output in fstab. Comment/Remove your old entries (excluding tmpfs) and use the new ones since your UUIDs have changed
9.  Change the entry for sda6 (the partition you created) to mount as /home. eg:

/dev/sda6 /home ext4 defaults 0 0

10.Unmount /mnt/root and /mnt/newhome
11.

mount -a && mount

(To test it)
12.Reboot into your hdd.


This makes sense in my head, perhaps someone can post pretty pictures or make it clearer?
I have assumed /home will be sda6. If not change the number as appropriate
If anything goes wrong your stuff is still under /old-home so you can mv that back to /home in a live cd and comment out the /home line in fstab
If the UUID throws up an error then try using /dev/sdaX where X is the mount point.


Rauchen verboten

Offline

#9 2011-10-22 11:32:40

teachop
Member
Registered: 2011-10-19
Posts: 4

Re: [SOLVED] Partitioning mix up, move /home and /boot

Thanks to all of you for the help.  The partitions are fine now.  I learned some things too.

I did edit partitions as explained by SS4 the above, and have now a small /boot and a big /home.

There was also a need to re-create an empty /home directory on the root partition before the new drive would automatically mount as /home when booting.

Last edited by teachop (2011-10-22 11:33:30)

Offline

Board footer

Powered by FluxBB