Mailing List Archive

Re: resizing and moving home directory to new partition on same drive
On 1/10/21 3:46 PM, antlists wrote:
> 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 I use "nano" to edit /etc/password file
all I need to change is the
user:x:1000:1000::/home/user:/bin/bash

to:
user:x:1000:1000::/mnt/home/user:/bin/bash

Or I need to use: "vipw -s"
Re: resizing and moving home directory to new partition on same drive [ In reply to ]
>
> Can I use "nano" to edit /etc/password file
>

Yes, but it's generally safest to use usermod.
Re: resizing and moving home directory to new partition on same drive [ In reply to ]
On 1/10/21 9:26 PM, Adam Carter wrote:
>>
>> Can I use "nano" to edit /etc/password file
>>
>
> Yes, but it's generally safest to use usermod.

When I try to use
usermod -d /mnt/home/thelma -m thelma
I get:
usermod: user thelma is currently used by process 3037

Do I need to boot strap for this to work?
RE: resizing and moving home directory to new partition on same drive [ In reply to ]
> -----Original Message-----
> From: thelma@sys-concept.com <thelma@sys-concept.com>
> Sent: Monday, January 11, 2021 05:07
> To: gentoo-user@lists.gentoo.org
> Subject: Re: [gentoo-user] resizing and moving home directory to new
> partition on same drive
>
> Can I use "nano" to edit /etc/password file all I need to change is the
> user:x:1000:1000::/home/user:/bin/bash
>
> to:
> user:x:1000:1000::/mnt/home/user:/bin/bash
>
> Or I need to use: "vipw -s"

I've always used vi for those, but only because I did not know there was a dedicated command! Anyway, these look like wrappers that set a lock and then invoke your editor. I suppose that in a single user, single admin environment it does not make much difference using nano vs vipw. BTW I don't think you'd need -s with vipw, the shadow file only contains password-related info which you do not want to change.

raffaele
Re: resizing and moving home directory to new partition on same drive [ In reply to ]
>
> When I try to use
> usermod -d /mnt/home/thelma -m thelma
> I get:
> usermod: user thelma is currently used by process 3037
>

Is 3037 an instance of bash running as thelma?

If so, try logging out that user then run the usermod command as root (not
thelma su'd to root)
Re: resizing and moving home directory to new partition on same drive [ In reply to ]
On 11/01/21 04:06, thelma@sys-concept.com wrote:
> On 1/10/21 3:46 PM, antlists wrote:
>> 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 I use "nano" to edit /etc/password file
> all I need to change is the
> user:x:1000:1000::/home/user:/bin/bash
>
> to:
> user:x:1000:1000::/mnt/home/user:/bin/bash
>
> Or I need to use: "vipw -s"
>
No - if you follow my suggestion you don't need to change anything. Just
make sure, before you wipe your old install you know which user numbers
are used for "user" - here it's 1000, and "thelma" if you've got a user
called thelma.

What I was worried about was you might have a line

0:x:0:0::/home/root:/bin/bash

What THAT line should be is

0:x:0:0::/root:/bin/bash

but it probably already is. You seem to be confusing the root user and
yourself - you need to get that straight in your head because if you
don't you're likely to give yourself some nasty shocks.

Cheers,
Wol