Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] I can't add users. I have a read-only file system?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 56
Location: USA

PostPosted: Fri Jul 26, 2019 1:05 am    Post subject: [SOLVED] I can't add users. I have a read-only file system? Reply with quote

I am installing Gentoo by following the Handbook. I made it as far as the Finalizing page. There it has me log in as root (which succeeded). It then wants me to create an ordinary user. That's where I'm failing.

First, I told it:

Code:
useradd -m -G users,audio,games,usb,video,wheel, -s /bin/bash ron


It told me that "games" did not exist. So I went with:

Code:
useradd -m -G users,audio,usb,video,wheel, -s /bin/bash ron


Then it said:

Code:
useradd: cannot open /etc/passwd
useradd: failed to unlock /etc/passwd


Scouring the forums & web, folks said to delete the /etc/*.lock files. I don't have any.

Someone else suggested that I run strace on the command that's failing. I discovered that I don't have that installed. So I ran:

Code:
emerge -atv strace


That gave the error:

Code:
!!! Read-only file system: /var/db/pkg
emergelog(): [Errorno 30] Read-only file system: b'/var/log/emerge.log'
emergelog(): [Errorno 30] Read-only file system: b'/var/log/emerge.log'


I'm wondering if that's another version of the problem I had creating the user. Something is wrong with the file system?

I tried rebooting the system, but that did not clear things up.

So my main problem is how do I fix this so I can add users?
My secondary problem is why can't I emerge strace?


Last edited by mojosam on Tue Aug 06, 2019 5:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 156

PostPosted: Fri Jul 26, 2019 1:47 am    Post subject: Reply with quote

are you installing from live iso or another system? mount everything like you would during install, do chroot and execute:
Code:
lsblk -o NAME,RO,RM,TYPE,FSTYPE,MOUNTPOINT,PARTLABEL

describe your drive scheme, which drives are which, how do you mount them? it this an ssd or hdd, how old is it.
Also why are you putting the last comma after all of the groups in that command?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14159

PostPosted: Fri Jul 26, 2019 2:03 am    Post subject: Reply with quote

If your filesystem is read-only, you cannot change files or directories on it. To install strace, or to add a user, you must change files and directories on the filesystem. Therefore, until you identify and fix the problem causing your filesystem to be read-only, you cannot proceed with the new user or the emerge.

What is the output of cat /etc/fstab ; cat /proc/self/mounts? Are there any relevant errors printed during boot?
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 56
Location: USA

PostPosted: Fri Jul 26, 2019 2:40 am    Post subject: Reply with quote

I'm installing from the Minimal Install CD, which I'm running from a bootable USB flash drive. It's going onto a little Dell Latitude 2110 netbook from the year 2010. It has a hard drive.

I'm using the partitioning scheme from the Handbook:

Code:
/dev/sda1   (bootloader)   2MB   BIOS boot partition
/dev/sda2   ext2         128MB   Boot/EFI sys partition
/dev/sda3   (swap)         2GB   Swap partition
/dev/sda4   ext4         150GB   Root partition


The last comma after all of the groups in useradd is just a transcription mistake I made when typing up my steps. I didn't have it in the actual command.

So now here's where it gets bizarre. I rebooted the machine via the Minimal Install CD [USB stick]. I tried to mount the filesystems, but it's telling me they don't exist!

I'm following the instructions on the "Installing the Gentoo base system" page of the Handbook (AMD64).
https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Base

Specifically, I'm following the process described under "Mounting the necessary filesystems". The mount commands there are not working for me today.

According to my notes, this process worked correctly for me a couple of days ago when I was going through it during the install process. So something is goofy somewhere.

Right now (booted into the CD but not chrooted), if I enter:

Code:
lsblk


all by itself, it tells me that sda1, sda2, sda3, and sda4 don't have mount points.

I think the scope of my problem has expanded greatly from my initial understanding of it!
Back to top
View user's profile Send private message
etnull
Apprentice
Apprentice


Joined: 26 Mar 2019
Posts: 156

PostPosted: Fri Jul 26, 2019 5:11 am    Post subject: Reply with quote

Quote:
Right now (booted into the CD but not chrooted), if I enter:

if you reboot they are obviously would not be mounted, you have to remount them again.

try to repeat the install, pay extra attention to partitioning and mounting,
also your netbook is probably not suited for EFI install, you should use legacy BIOS instead.
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 56
Location: USA

PostPosted: Fri Jul 26, 2019 3:52 pm    Post subject: Reply with quote

Quote:
if you reboot they are obviously would not be mounted, you have to remount them again.


I know, but the mount command doesn't work. (The machine is off right now, so I can't give you the exact message.)

Quote:
your netbook is probably not suited for EFI install, you should use legacy BIOS instead.


It is using BIOS. That "Boot/EFI sys partition" text above I had just copied out of the Handbook. Otherwise, it reflects my layout.

Code:
try to repeat the install, pay extra attention to partitioning and mounting


OK. I'll try to tackle that on Monday. I think you're right. I went off the rails somewhere in that process.
Back to top
View user's profile Send private message
skellr
l33t
l33t


Joined: 18 Jun 2005
Posts: 901
Location: The Village, Portmeirion

PostPosted: Fri Jul 26, 2019 6:59 pm    Post subject: Reply with quote

Yeah, just try to remount root and it will probably spew some information.
Code:
mount -o remount,rw /


Maybe a typo in fstab or some error during init.
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 56
Location: USA

PostPosted: Tue Aug 06, 2019 5:01 am    Post subject: Reply with quote

I'm back!

So I finally made it through the reinstall process, all of the way from the beginning. I'm basically back to the problem I had at the beginning of this thread.

So starting from the Finalizing page of the Handbook, it wants me to create a daily user:

Code:
useradd -m -G users,audio,usb,video,wheel-s /bin/bash ron


Yes, I accidentally omitted the space between "wheel" and "-s". I'm mentioning it here, in case this has created or complicated my problem. Of course it complained that "wheel-s" does not exist. It wasn't clear whether the user had been created, though, so I tried again:

Code:
useradd -m -G users,audio,usb,video,wheel -s /bin/bash ron


It reported:

Code:
useradd: cannot open /etc/passwd
useradd: failed to unlock /etc/passwd


So the first thing I looked for was /etc/*.lock files. I discovered that I had one named .pwd.lock.

I tried to banish the beast:

Code:
rm /etc/.pwd.lock


And was treated to this response:

Code:
rm: cannot remove `.pwd.lock`: Read-only file system


I tried to mount the drives:

Code:
mount /dev/sda4 /mnt/gentoo


That failed. It turns out that /mnt/gentoo doesn't exist. I don't know why. I tried to create it. That failed, of course, because it says I have a read-only file system.

Code:
cat /etc/fstab


reports:

Code:
# <fs>          <mountpoint>   <type>   <opts>            <dump/pass>
LABEL=boot      /boot          ext4     defaults,noatime  0 2
LABEL=swap      none           swap     sw                0 0
LABEL=rootfs    /              ext4     noatime           0 1


Code:
cat /proc/self/mounts


reports:

Code:
/dev/root / ext4 ro,relatime 0 0
devtmpfs /dev devtmpfs rw,nosuid,relatime,size=10240k,nr_inodes=252656,mode=755 0 0
proc /proc proc rw,nosuid,nodev,noexec,relatime 0 0
tmpfs /run tmpfs rw,nodev,relatime,size=202488k,mode=755 0 0
sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,nosuid,nodev,noexec,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
cgroup_root /sys/fs/cgroup tmpfs rw,nosuid,nodev,noexec,relatime,size=10240k,mode=755 0 0
openrc /sys/fs/cgroup/openrc cgroup rw,nosuid,nodev,noexec,relatime,release_agent=/lib/rc/sh/cgroup-release-agent.sh,name=openrc 0 0
none /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0
cpu /sys/fs/cgroup/cpu cgroup rw,nosuid,nodev,noexec,relatime,cpu 0 0
cpuacct /sys/fs/cgroup/cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpuacct 0 0
freezer /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0
mqueue /dev/mqueue mqueue rw,nosuid,nodev,noexec,relatime 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
shm /dev/shm tmpfs rw,nosuid,nodev,noexec,relatime 0 0
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,nosuid,nodev,noexec,relatime 0 0
/dev/sdb1 /media/usb-drive vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 0


Any ideas on what to try next?
Back to top
View user's profile Send private message
mega_flow
n00b
n00b


Joined: 26 Jun 2016
Posts: 32
Location: Belgium, Maasmechelen

PostPosted: Tue Aug 06, 2019 6:28 am    Post subject: Reply with quote

Hi

on a i686-pc-linux-gnu (thinkpad x40) I had the same issue, because I don't have a kernel option enable CONFIG_LBDAF
ext4 file system need this, so maybe it is a kernel problem
_________________
i5-4590 CPU @ 3.30GHz, [AMD/ATI] Ellesmere [Radeon RX 470]
default/linux/amd64/17.1/desktop/plasma
Back to top
View user's profile Send private message
g2g591
Apprentice
Apprentice


Joined: 17 Sep 2007
Posts: 238

PostPosted: Tue Aug 06, 2019 11:50 am    Post subject: Reply with quote

mega_flow wrote:
Hi

on a i686-pc-linux-gnu (thinkpad x40) I had the same issue, because I don't have a kernel option enable CONFIG_LBDAF
ext4 file system need this, so maybe it is a kernel problem

In older versions it was called CONFIG_LBD, but is the same thing
Back to top
View user's profile Send private message
freke
Guru
Guru


Joined: 23 Jan 2003
Posts: 474
Location: Somewhere in Denmark

PostPosted: Tue Aug 06, 2019 12:13 pm    Post subject: Reply with quote

Your /etc/fstab is not supposed to look like that - from the handbook
Code:
FILE /etc/fstab A full /etc/fstab example

/dev/sda2   /boot        ext2    defaults,noatime     0 2
/dev/sda3   none         swap    sw                   0 0
/dev/sda4   /            ext4    noatime              0 1
 
/dev/cdrom  /mnt/cdrom   auto    noauto,user          0 0

ie. the LABEL=boot etc. should be replaced by the partitations you made.

https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/System
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 56
Location: USA

PostPosted: Tue Aug 06, 2019 5:24 pm    Post subject: Reply with quote

Quote:
Your /etc/fstab is not supposed to look like that - from the handbook
...
ie. the LABEL=boot etc. should be replaced by the partitations you made.


D'oh!

I don't know where I picked that up. Maybe it's in the sample fstab installed by Gentoo, and I removed the #.

Anyway, the system works now! Thanks to all who helped.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14159

PostPosted: Wed Aug 07, 2019 1:14 am    Post subject: Reply with quote

LABEL=boot is fine, if you set a label on your filesystem. If the filesystem is not labeled the same as in fstab, then it won't match and the fstab line will not matter.
Back to top
View user's profile Send private message
mojosam
n00b
n00b


Joined: 21 Jul 2019
Posts: 56
Location: USA

PostPosted: Wed Aug 07, 2019 7:05 am    Post subject: Reply with quote

Quote:
LABEL=boot is fine, if you set a label on your filesystem.


This is what I changed it to. It works now.

Code:
# <fs>         <mountpoint>   <type>   <opts>            <dump/pass>
/dev/sda2      /boot          ext4     defaults,noatime  0 2
/dev/sda3      none           swap     sw                0 0
/dev/sda4      /              ext4     noatime           0 1
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum