Wiki Ubuntu-it

Indice
Partecipa
FAQ
Wiki Blog
------------------
Ubuntu-it.org
Forum
Chiedi
Chat
Cerca
Planet
  • Pagina non alterabile
  • Informazioni
  • Allegati
  • Differenze per "Hardware/DispositiviPartizioni/SpostareHomePartizioneSeparata"
Differenze tra le versioni 7 e 8
Versione 7 del 19/09/2010 17.30.22
Dimensione: 7430
Commento:
Versione 8 del 19/09/2010 17.35.25
Dimensione: 7522
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 11: Linea 11:
Questa guida è stata liberamente tradotta dall'inglese per permettere di avere ulteriori punti di riferimento rispetto alle diverse informazioni già esistenti.Le Guide della Comunità sono un modo particolarmente utile di aiutare gli altri in uno stesso momento. Questa guida: Questa guida è stata liberamente tradotta dall'inglese ( https://help.ubuntu.com/community/Partitioning/Home/Moving ) per permettere di avere ulteriori punti di riferimento rispetto alle diverse informazioni già esistenti. Le Guide della Comunità sono un modo particolarmente utile di aiutare gli altri in uno stesso momento. Questa guida:
Linea 16: Linea 16:
          o

            People test and gain familiarity with the tools before the final crunch-test
, another advantage of this guide. Some other guides use mount commands, then move the /home & then set-up fstab. However, if you mess up your fstab at that crunch-point then when you reboot your system will lose track of your /home files! Setting up fstab first and using "sudo mount -a" to mount the partitions checks the modified fstab works at a safe point in the process.
          o   Le persone provano ed acquisiscono familiarità con gli strumenti prima che ci sia un "disastro" finale, e questo è un altro vantaggio della guida. Altre guide usano comandi mount, dopodichè spostano la /home e modificano fstab. However, if you mess up your fstab at that crunch-point then when you reboot your system will lose track of your /home files! Setting up fstab first and using "sudo mount -a" to mount the partitions checks the modified fstab works at a safe point in the process.

BR Indice()

HomeSpostarePartizioneDedicata

I vantaggi di questa Guida

Questa guida è stata liberamente tradotta dall'inglese ( https://help.ubuntu.com/community/Partitioning/Home/Moving ) per permettere di avere ulteriori punti di riferimento rispetto alle diverse informazioni già esistenti. Le Guide della Comunità sono un modo particolarmente utile di aiutare gli altri in uno stesso momento. Questa guida:

  • Ambisce a mantenere in funzione il sistema e a proteggere i dati in modo sicuro.
    • o Se il sistema dovesse spegnersi inaspettatamente, andare in ibernazione o dovesse accadere qualcosa d'altro durante l'esecuzione di questa procedura, sarebbe sufficiente ri-avviare il sistema e continuare a lavorare. Questa d'altra parte è l'ambizione di questa guida.
  • Prepara Partizioni e fstab prima, modificando fstab solo alla fine.
    • o Le persone provano ed acquisiscono familiarità con gli strumenti prima che ci sia un "disastro" finale, e questo è un altro vantaggio della guida. Altre guide usano comandi mount, dopodichè spostano la /home e modificano fstab. However, if you mess up your fstab at that crunch-point then when you reboot your system will lose track of your /home files! Setting up fstab first and using "sudo mount -a" to mount the partitions checks the modified fstab works at a safe point in the process.
  • Use rsync to move the files
    • o
      • Rsync is designed for backups of /home, and much more. It is able to maintain other characteristics of the file, like permissions, ownership, and timestamps. There was a lot of debate about which command to copy your files to the new /home partition which stemmed from a time when cp was not able to do it properly (apparently it skipped files?). Cp was not designed to be a powerful backup tool, rsync was. The fix, then, was to use a combination of find and cpio (See section 8.3.5).

La Guida

Configurare una /home su una partizione separata e dedicata offre dei benefici on a separate partition is beneficial because your settings, files, and desktop will be maintained if you upgrade, (re)install Ubuntu or another distro. This works because /home has a sub-folder for each user's settings and files which contain all the data & settings of that user. Also, fresh installs for linux typically like to wipe whatever partition they are being installed to so either the data & settings need to be backed-up elsewhere or else avoid the fuss each time by having /home on a different partition.

Setup Partitions

This is beyond the scope of this page. Try here if you need help. Memorize or write down the location of the partition, something like /sda3. Its been suggested to use either ext2, ext3 or ext4 rather than vfat or ntfs. Using vfat is not supported and may fail, since vfat does not support permissions. Ntfs has an advantage of being journalised, like ext3 & ext4 but it can also be read easily by Windows. It is a lot less stable than ext3 or ext4 so it is really a question of stability compared with easy access for Windows. If you don't dual-boot with Windows or have plenty of hard-drive space then staying with very much safer ext3 or 4 is the obvious choice.

Find the uuid of the Partition

The uuid reference to all partitions get to a command-line to try this

 sudo blkid 

Alternatively, for some older releases of Ubuntu the "blkid" command might not work so this could be used instead

 sudo vol_id -u <partition>  

for example

 sudo vol_id -u /dev/sda3  

Now you just need to note down (copy&paste into a text-file) the uuid of the partition that you have set-up ready to be the new /home partition.

Setup Fstab

These commands should;

  1. Creates a backup of fstab. The "$(date +%Y-%m-%d)" at the end automatically (and quite cleverly) gives the file today's date backwards.
  2. Compares fstab with the new back-up just to be certain it's good.
    • Opens the standard text-editor (gedit) in Ubuntu to edit fstab. Note that Kubuntu uses "kate" & Xubuntu uses "mousepad" instead but you could use any text-editor you have installed if you prefer.

{{{ sudo cp /etc/fstab /etc/fstab.$(date +%Y-%m-%d) cmp /etc/fstab /etc/fstab.$(date +%Y-%m-%d) gksu gedit /etc/fstab }}}

and add these lines into it

{{{ # (identifier) (location, eg sda5) (format, eg ext3 or ext4) (some settings) UUID=???????? /media/home ext3 nodev,nosuid 0 2 }}}

Replace???????? with the UUID number of the intended /home partition.

The Fstab location will be a temporary one - we are to mount the temporary location and copy the existing home to it. (/media/home is assumed in the rest of the guide). If /media/home does not exist yet, then you should create it with the command:

 sudo mkdir /media/home  

Now, mount the partition with:

 sudo mount -a  

Copy /home to the New Partition

 sudo rsync -axS --exclude='/*/.gvfs' /home/. /media/home/.  

The --exclude='/*/.gvfs' prevents rsync from complaining about not being able to copy .gvfs, but I believe it optional. Even if rsync complains, it will copy everything else anyway. (See here for discussion on this)

Check Copying Worked

The data in /home now exists in 2 places but we need to check that it looks about right. If it looks approximately the same then it is probably completely right.

A Sneaky Safety Manoeuvre

So you now have 2 copies of your /home folder. The new one on the new partition and the old one still in the same partition it was always in. The problem is how to delete the right one!! Since we are still using the old /home 'just' rename your current /home folder:

{{{ cd / sudo mv /home /old_home }}}

Now re-create a new blank /home directory just in case it has all gone wrong!

{{{ cd / sudo mkdir -p /home/user }}}

Now if things have gone wrong then the system will boot into what appears to be a fresh install with all your data missing. In fact, of course, there are still 2 copies of it all :)

Make the Switch

We now need to modify the fstab again to point to the new /home and mount it properly. So again on a command-line

 gksu gedit /etc/fstab  

and now edit the lines you added earlier to delete the /media part. This should make /media/home into /home as follows

{{{ # (identifier) (location, eg sda5) (format, eg ext3 or ext4) (some settings) UUID=???????? /home ext3 nodev,nosuid 0 2 }}}

and finally, remount the partition with:

 sudo mount -a  

Does it all still look fine? Can you still access your files & folders from the "Places" menu? Reboot to ensure that currently running programs use the /home that is on the new partition.

After a reboot

If everything is working, great, you can delete /old_home. If things aren't working, you can undo by moving your /old_home back to /home, and delete the line you added to fstab.

Technical Notes and Resources

Rsync was chosen over cp and find|cpio because it seemed to maintain permissions.

http://ubuntu.wordpress.com/2006/01/29/move-home-to-its-own-partition/

http://ubuntuforums.org/showthread.php?t=46866


CategoryNuoviDocumenti