01.10.2014, 18:04 UhrDeutsch | English
Hallo Gast [ Registrierung | Anmelden ]
Moving your Home directory to another Partition

while doing the Installation


If one wants to put the home directory on another partition, in order to install for instance a new Kanotix version on the hard drive, without overwriting the old user set of data (e.g. Mozilla Mails, Preferences etc.), the following procedures can be followed:

(This is a presentation of the most relevant passages from that posting: posts on moving home

First create a partition for the "new" /home and format it in an appropriate Linux format.
1) Then open a terminal, become root, and type:
# sudo kanotix-installer


2) Select point 1 in the running graphic installation mode (Configure Installation). Select the desired target partition and/or hard drive after and follows the subsequent installation steps).

3) At the conclusion of the installation configuration - select point 5 (Save config) and select ".knofig" as file name. Quit the installer for the time being with point 6 (Quit ).

4) In a new, root terminal:
$ sudo mcedit .knofig 
Open MC, and add a few lines in the file ".knofig" with the following information:
~a) To select the preformatted home partition, e.g.:
HD_MAP="/dev/hda5:/home" 

~b) In order to allow the installation on a smaller partition if need be:
HD_IGNORECHECK=yes

~c) In order to select another root partition if necessary:
HD_CHOICE="/dev/hda1"

(The modification of line A is usually sufficient for usual normal cases, just make sure however that the correct location of the proper hard disk is given.)

To finish, store the file with F2. You can exit MC with F10.

5) Now start the installer again (sudo kanotix-installer) in a root terminal, load the installation configuration that was previously stored (point 4) .knofig" and let the installation begin and run as usual with point 2 (Installation starten).

When everything works right, one gets, after after rebooting and typing the command < mount > in a console, the following line (and/or similar): /dev/had5? on /home type reiserfs (rw).

Further explanations and reference are available in the thread quoted at the beginning.


Later


There's 2 ways. The first one assumes all programs are decently enough coded to actually look up the users home directory. If some program just looks up your user name and tries to find your home directory in /home/<username>, this is gonna cause a lot of trouble. A cleaner way is the second one.

1st way
You can redefine, as root, what all programs consider as home directory in Linux, by means of usermod D/daten/.home/kanotix kanotix, whereby the second kanotix username is now the new home directory of the first.

I have just included the point so that I do not have to rebuild constantly that stupid home (I have a second hard drive mounted as /data, so that I have in fact in my home directory only configuration files, preferences, ...). Surely one can also modify where the KDE directory (Desktop...) too somewhere into ~/kanotix/.kde, or restart KDE, then correct that in the control center, and start it again.

2nd way (a little more of an effort to set up, but less error-prone afterwards)
We assume you've got Kanotix installed on /dev/hda5? and want your /home shifted to /dev/hda6?.

If you don't, change all references to hda5?, hda6? accordingly. Furthermore we assume /dev/hda6? to be formatted (see man mkfs). Commands to be entered are spelled in blue (maybe).
1. boot from CD
2. open Konsole
3. sudo su
4. mount /mnt/hda5?
5. mount /mnt/hda6? -o rw
6. cd /mnt/hda5?/home
7. tar -cf - . | (cd /mnt/hda6?/; tar -xvf -)
8. add a line
/dev/hda6  /home  reiserfs  defaults,auto   0  0 
to your /etc/fstab (adapt "reiserfs" according to your filesystem)
9. reboot

NB: none of the files on /dev/hda5?/home get harmed during this process. So to free the disk space occupied by these files, feel free to delete them some time. Just make sure you know where you're deleting those files from! An idea would be to (while running the hd install) mount /dev/hda5? (which is already mounted on /) again on /mnt/hda5? and delete them then. In case you mess up your partition names you can destroy all the data in your home directory, so think before you type. If you don't need the disk space freed, you can leave them where they were (they'll be taken care of anyway after the next reinstallation).
NB 2: thus if something goes wrong during the process you can try over and over - remember, an exact copy of your files is still in /dev/hda5?/home
XML Revisions of $tag
Seiten-History :: Letzter Editor : Richard :: Eigentümer : OffTopic ::
Powered by pnWikka 1.0
 
 
Deutsch | English
Logos and trademarks are the property of their respective owners, comments are property of their posters, the rest is © 2004 - 2006 by Jörg Schirottke (Kano).
Consult Impressum and Legal Terms for details. Kanotix is Free Software released under the GNU/GPL license.
This CMS is powered by PostNuke, all themes used at this site are released under the GNU/GPL license. designed and hosted by w3you. Our web server is running on Kanotix64-2006.