Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #188575

(solved) Re: how to add a /home partition

From Long Wind <longwind2@yahoo.com>
Newsgroups linux.debian.user
Subject (solved) Re: how to add a /home partition
Date 2017-11-03 23:30 +0100
Message-ID <uHSDn-2fO-1@gated-at.bofh.it> (permalink)
References <uHRnY-C9-3@gated-at.bofh.it> <uHRnY-C9-1@gated-at.bofh.it> <uHRQZ-Nz-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

 Thank Pol Hallen and tomas@tuxteam.de!
tomas's instruction is detailed and professional, many thanks! 




 

    On Friday, November 3, 2017 5:34 PM, "tomas@tuxteam.de" <tomas@tuxteam.de> wrote:
 

 -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, Nov 03, 2017 at 09:06:28PM +0000, Long Wind wrote:
> i have installed wheezy at /dev/sda3, no swapdisk space isn't enough nowi want to add /dev/sda4 as /home partitionbut how to do it? Thanks!

First, take a backup. Things tend to go wrong if they can!

Do all of this as root. Best if no user is logged in (since
this might change the contents of /home during the procedure;
safest is if you boot in single user mode)

 - if not done yet, set up a file system of your choice (I'll
  assume ext4, adjust to taste)

  mkfs.ext4 /dev/sda4

  *THIS WILL WIPE THE CONTENT OF /dev/sda4*

 - add /dev/sda4 to your /etc/fstab:

  a line like this

  /dev/sda4 /home          ext4    defaults        0      2

  (instead of /dev/sda4 you can insert the disk's UUID, which
  you find out with "sudo blkid /dev/sda4". This has the advantage
  that the blkid is sometimes more stable than the device name)

  Adjust your file system 

  *DON'T REBOOT YET*

 - copy the content of /home to your new disk:
  for example
  - mount /dev/sda4 somewhere suitable:

    mount /dev/sda4 /mnt

  - copy the contents of /home to its future location:

    rsync -av /home/ /mnt/
    (slashes are important)

    or cp -a /home/* /mnt

  - test your setup. Either issue "mount -a" and login as normal user
    or just reboot normally (if you were in single user mode, just
    reboot). All working?

  - if yes, you can wipe the content of your old /home, which is
    still taking up space on your /dev/sda3:

  - boot into single user mode

  - unmount /home (which is now /sda4)

    umount home

  - now your old home becomes visible. Wipe it

    rm -Rf /home/*

  - reboot. Done!

You didn't forget to take a backup, did you?

Don't hesitate to ask if anything is unclear. Proceed with caution!

Cheers
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAln84MkACgkQBcgs9XrR2kbz7wCfeWc8yEixUpWTzGc1hg3hW5Y0
JSQAnA0ivC9LtlVJ0xNBiUcMapKbEofl
=Zjy3
-----END PGP SIGNATURE-----



   

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

how to add a /home partition Long Wind <longwind2@yahoo.com> - 2017-11-03 22:10 +0100
  Re: how to add a /home partition Pol Hallen <deben@fuckaround.org> - 2017-11-03 22:40 +0100
  Re: how to add a /home partition <tomas@tuxteam.de> - 2017-11-03 22:40 +0100
    (solved) Re: how to add a /home partition Long Wind <longwind2@yahoo.com> - 2017-11-03 23:30 +0100
    Re: how to add a /home partition Michael Lange <klappnase@freenet.de> - 2017-11-04 00:40 +0100
      Re: how to add a /home partition <tomas@tuxteam.de> - 2017-11-04 08:50 +0100

csiph-web