From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EC64F1382C5 for ; Mon, 11 Jan 2021 01:17:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E037FE0AAF; Mon, 11 Jan 2021 01:17:40 +0000 (UTC) Received: from smtp.hosts.co.uk (smtp.hosts.co.uk [85.233.160.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 948FDE0A76 for ; Mon, 11 Jan 2021 01:17:40 +0000 (UTC) Received: from host86-158-105-41.range86-158.btcentralplus.com ([86.158.105.41] helo=[192.168.1.64]) by smtp.hosts.co.uk with esmtpa (Exim) (envelope-from ) id 1kylpw-0009Pa-8m for gentoo-user@lists.gentoo.org; Mon, 11 Jan 2021 01:17:37 +0000 Subject: Re: [gentoo-user] resizing and moving home directory to new partition on save drive To: gentoo-user@lists.gentoo.org References: <0de4c60d-1889-3bae-eab7-64cd8279952e@youngman.org.uk> <73566364-c791-ca4b-44e8-d348c5c410f4@sys-concept.com> From: Wols Lists X-Enigmail-Draft-Status: N1110 Message-ID: <5FFBB074.9010902@youngman.org.uk> Date: Mon, 11 Jan 2021 01:57:08 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 In-Reply-To: <73566364-c791-ca4b-44e8-d348c5c410f4@sys-concept.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: 738baec4-3820-414a-9d71-ce1d3ace230c X-Archives-Hash: 7cd7089062982c24845cdccbde9f86ae On 11/01/21 00:31, thelma@sys-concept.com wrote: > On 1/10/21 3:46 PM, antlists wrote: >> On 10/01/2021 21:42, thelma@sys-concept.com wrote: >>> I want to move /home directory to a new partition (save drive). >>> >>> I have 1-SSD drive: >>> Filesystem Size Used Avail Use% >>> /dev/sda4 916G 405G 464G 47% / >>> >>> >>> Home directory is on it taking about 360GB >>> >>> I was planning doing it in stages. >>> >>> Stage-1 >>> Using Gparted to resize "/" portion shirk it to about 450GB >>> create new ext4 partition for /home /dev/sda5 >>> >>> Boot-strap the PC with live-gentoo >>> mv /home /home.org >>> mkdir /home >>> mount ext4 /dev/sda5 /home/ >>> >>> cp -rp /home.org/* /home/ >>> >>> edit fstab: >>> /dev/sda5 /home ext4 default 0 0 >>> reboot and test home >>> >>> Am I missing something? >> >> Couple of things. >> >> Firstly, why use a gentoo live disk? Just log in as root. >> >> Secondly, why rename home? Just mount sda5 on /mnt to do the move, then add it to fstab to mount on /home. >> >> And a little bit you might have missed - DON'T put root's home on a mounted disk - if it's currently in /home, move it to /. Don't forget to edit /etc/passwd if you have to move it. > > Can you elaborate pls.? > My current "home" is in "/"; so why move it there, it is already there. > I don't have extra disk around, but I could copy /home over network to another PC. Are you logging in as root?! THAT'S DANGEROUS! Probably not, you are probably misunderstanding me. I've just checked, on my system, root's home is /root, which is as it should be. Is your home /home/username, or is it /username? You make it sound like it's /username, which I don't think is what you mean ... > > I was planning to move "home" to another partition as I plan to wipe old installation (it is impossible for me to upgrade); it will be easier to reinstall. > My old installation is: > Portage 2.3.24 (python 3.5.4-final-0, default/linux/amd64/17.0/desktop, gcc-6.4.0, glibc-2.25-r10, 4.9.72-gentoo x86_64) > > Since, old installation has home or "/" (root) partition, if I wipe the root, home will be gone as well. So I was planning on moving "home" to another partition, this way all data will be there. > So, after moving "home" to another partition "sda5" I can wipe the "sda4" and re-install gentoo. "home" data would not be touched by upgrade. > > Ahh ... you didn't say that! That changes everything! Okay. I would look to free about 380GB (just enough) at the end of the disk to create sda5 which will be (at least temporarily) your new /home. LOGGED IN AS ROOT just mount that on /mnt, and copy the contents of /home into it. Now using your gentoo install disk delete sda4 and split it into two - your new sda4 for your new gentoo, and a new sda5 (AT LEAST as big as one you created in the last step), which will shunt the partition you just created into sda6. Install your new gentoo. Now you've got sda4 (/), sda5 (which will be /home), and sda6 (where you've just copied your old /home). Mount sda6 on /mnt again, and copy it to /home (sda5). Finally, delete sda6, extend sda5 to use the space you've just freed, and expand the filesystem on /home to use the full size of the extended partition. That'll probably leave you with a 150GB /root, but that'll be plenty I expect (and a 760GB /home). Cheers, Wol