Re: Mounting home to a different partition



In alt.os.linux.suse, on Tue 28 February 2006 07:05, Amnon Feiner
<none@xxxxxxxx> wrote:

Hi all

What i am trying to do is change my home partiton from the 9GB /Home I
have now to the 65 GB /storage. Am I better off stretching home, or is
there a reasonable way to do it?

If Kevin continues to maintain the alt.os.linux FAQ then this would be a
classic example for inclusion, so often has it been asked.

If there is unused space after the /home partition, you *could* resize
the partition after taking backups of *all* the contents onto another
medium, then backing up everything in the partition onto another
medium. However, this approach is not for the fainthearted.

The more classic approach is as follows:

1 Allocate another partition of the size you want
(or reuse another that you don't use for anything else)

2 Make the filesystem on the new partition

3 To ensure that you do not have anything running that will change the
contents of /home, log in as root on a virtual terminal (not a
Konsole under KDE or one of the equivalents), and issue the command

telinit 1

This will take you to single user mode

4 Mount the new partition as /new_home and issue the command

cp -a /home/* /new_home/

The -a will recurse through the subdirectories, will not follow
symlinks, but will preserve them as links, and will preserve
ownership, mode and timestamps.

This command will take some time.

5 umount /home

6 Edit the line in /etc/fstab that mounts /home to give it the device
of the /new_home partition. For example, if /home uses reiserfs on
/dev/hda11 and /new_home uses reiserfs on /dev/sdb3, you should
change the line that looks like

/dev/hda11 /home reiserfs acl,user_xattr 1 2

to make it look like

/dev/sdb3 /home reiserfs acl,user_xattr 1 2

7 mv /home /old_home

8 mv /new_home /home

9 Return to your usual graphical login by using telinit 5

Once you have been using the system for a while with no problems, you
can get rid of /old_home and reuse the partition for other things

HTH
HANDY
--
Robert HULL

Archival or publication of this article on any part of thisishull.net
is without consent and is in direct breach of the Data Protection Act
.



Relevant Pages

  • mounting drive
    ... When I use the df command it shows that 90% of /dev/hdd2 is full. ... mount /dev/hdb3 /mnt ... then I edited my fstab file just the line regarding /oldmnt/5.5 ... Ie. /usr looked like it was mounted to the correct partition ...
    (comp.os.linux.misc)
  • Re: dd and cp -a
    ... I redid /sdb5 with another ext3 file system and I can mount it to /mnt on this computer. ... Command: p # you enter the "p" part at the end ... - Check the partition you just made: ... Cpio will preserve any hard and soft links it finds and will also ...
    (Fedora)
  • Re: After system didaster how to prepare / save most important data ?
    ... mount a partition of the external drive to /mnt. ... sudo cp -a /home /mnt ...
    (Ubuntu)
  • Re: Moving /home
    ... /dev/hdax is the new partition location. ... And here's the actual mount. ... This complicated-looking command is two tar commands end to end. ... This is with compression and an explicit file as an ...
    (comp.os.linux.setup)
  • Re: SanDisk Mini Cruzer USB memory stick
    ... I tried the to see if it would still mount: ... No real file system on the stick. ... Enter "d" to delete the partition tables one by one ... Have the Flash Drive formatted by FAT file system with the command ...
    (Fedora)