Penguin
Blame: BackingUpYourHomeDir
EditPageHistoryDiffInfoLikePages
Annotated edit history of BackingUpYourHomeDir version 2, including all changes. View license author blame.
Rev Author # Line
1 ElroyLiddington 1
2 !A brief HOWTO on moving your '/home' folder to another partition (or back again).
3
4 REQUIRES INTEGRITY/READINESS/CONTINUITY CHECK ON PROCEDURE BEFORE GENERAL USE!!!
5 ----
6
7
8 !First off:
9
10 !!!BACK UP IMPORTANT DATA!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
11
12
13
14 ----
15
16
17
18 !! Overview:
19
20 * Move '/home' to a Temporary '/home' Partition
21 * Format Old '/home'
22 * Delete/Recreate Partition ('/home'_old and '/home'_new)
23 * Move Your Data Back.
24
25 ----
26
27
28 !! Lets do it!
29
30
31
32 #Create new '/home'_temp partition and format, then quick integrity check:
33
34 *'cfdisk /dev/xxxx'
35 * REBOOT!!! - is this really needed?
36 *'mkfs.ext3 -c /dev/xxxx'
37 * REBOOT!!! - is this really needed?
38 *'fsck.ext3 -c /dev/xxxx' (Extra -c redundant from mkfs -c?)
39
40 #Move/redirect '/home'_old to temp partition/drive,
41
42 *'<your-fav-text-editor-here> /etc/fstab'
43 * Locate the line with '/home' in it.
44 * Carefully remove the '/dev/xxxx...' at the beginning, and replace with that of your newly created temp partition.
45 * SAVE!
46 * This is where we mount our new temp dir:
47 * 'mkdir /media/xxxx'
48 * This mounts our temp EXT3 partition to our previously created mount point '/media...' etc:
49 * 'mount -t ext3 /dev/xxxx /media/xxxx
50 * Copies (recursively) our user data from old '/home':
51 * 'cp -R /home/* /media/xxxx'
52 * Check our copy worked OK:
53 * 'diff -r /home/* /media/xxxx'
54
55 * If any errors are output from the above step, they SHOULD? (NEEDS CONFIRMATION!!) be noted in the output from 'diff'.
56
57
58
59
60 #Delete/Reformat old '/home':
61
62 * Remove original user(s) from the /home folder (stops the system getting confused later when we re-add them?!?)
63 * 'userdel user1'...user2...etc'
64 * Nuke old partition - make sure you delete the right one!!!
65 * 'cfdisk /dev/xxxx'
66 * REBOOT!!! - is this really needed?
67 * Create new partition from free space from old one
68 * 'cfdisk /dev/xxxx'
69 * REBOOT!!! - is this really needed?
70
71
72 #Move/redirect user/data/mount-point back to original partition
73 * Edit '/etc/fstab' to change your '/home' entry from '/home'_old to '/home'_new
74 * SAVE!!
75 * REBOOT!!
76
77
78 #Profit!!!
79
80
81
82
83 !!NOTES:
84
85 1) Turns out, if you log on as root/single user in recovery mode, you can put stuff from /home into /root - because when logged on as root, this is your /home folder?
86 On Ubuntu at GRUB screen - hit ESC/select Ubuntu xxx.xx.xxx (recovery).
87
88 2) Every change/write in fdisk/cfdisk needs a reboot?
89 Same for partition formatting?!?
90
91
92
93 3) Something I discovered:
94
95 After recreating /home, then doing an 'adduser xxx', then logging in as that user, my permissions had changed... I was running as a more restricted user than previously.
96
97 Turns out, apparently Ubuntu has the first non-root user account with additional 'special' permissions - seeing as I removed all users bar root, then recreated that first user, it took a reboot for that users permissions to come right...
98
99
100 4) I had a spare partition (1) (blank drive space) available, so I put my temporary '/home' there while I reformatted my old '/home' partition.
101
102
103 I pretty much did everything as 'root' user - I think I should be using SUDO, but I haven't grokked? that concept yet :-)

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()