Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
new install: first boot and / is write-only (solved)
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
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 945
Location: Belgium

PostPosted: Sat Aug 08, 2020 1:22 pm    Post subject: new install: first boot and / is write-only (solved) Reply with quote

I just got as far as booting my new installation. I have gone UEFI this tme, followed the handbook (got into some motherboard cofig trouble) and now I get into grub and can boot the kernel. First thing I wanted to do is add a user. So I logged in as root. But I got the "cannot lock paaswd file". I tried to remove the .pwd.lock file but I could not as the filesystem is read-only.

So I exited the shell and logged in again (as root). Now I get "-bash: adduser: command not found". If I mount any other HD, then I can write a file to it.

I see nothing special in the fstab
Code:

UUID=008e-3105                                                      /boot        vfat       noauto,noatime       0 2
UUID=5ee9cd8c-daba-48eb-ac2f-ccbb755fc5b5    none        swap   sw                           0 0
UUID=65b3e5eb-04b2-4cf8-9a6a-61e6ad938397   /               xfs        noatime                   0 1

_________________
Expert in non-working solutions


Last edited by Spanik on Sun Aug 09, 2020 11:46 am; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sat Aug 08, 2020 1:33 pm    Post subject: Reply with quote

Spanik,

Try useradd.
The adduser symlink wan dropped a long time ago.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 945
Location: Belgium

PostPosted: Sat Aug 08, 2020 1:47 pm    Post subject: Reply with quote

That was a typo, it is useradd I used
Code:

(none) ~ # useradd -m -G users,wheel,audio,usb -s /bin/bash <me>
useradd: cannot lock /etc/passwd; try again later
(none) ~ # cd /etc
(none) /etc #: rm .pwd.lock
rm: cannot remove '.pwd.lock' : Read-only file system
(none) /etc # touch test.txt
touch: cannot touch 'test.txt' : Read-only file system
(none) /etc #

Same error when I use nano to create a simple .txt file: Read-only file system.

I wanted to check what is in dmesg but there isn't a dmesg in /var/log.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 945
Location: Belgium

PostPosted: Sat Aug 08, 2020 2:05 pm    Post subject: Reply with quote

I looked into grub.cfg and I see:
Code:

linux  /vmlinuz-4.5.48-gentoo root=/dev/nvme0n1p4 ro

So it looks like grub is setting / as read only. Why would it do that? And why does fstab not overrules that after boot.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sat Aug 08, 2020 2:13 pm    Post subject: Reply with quote

Spanik,

For most filesystems, root is mounted read only until rootfsck has run.
Then it gets remounted read write.

I don't use xfs, hence I said "most fs".. That may indeed be the problem. I am aware of at least one filesystem where mounting root read only, as grub does, prevents rootfsck from being run.

You don't get any logs written out until you have some read/write space to write them to.
The dmesg command should still work as it will display the kernel log ring buffer.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 945
Location: Belgium

PostPosted: Sat Aug 08, 2020 2:46 pm    Post subject: Reply with quote

Ok, seems to be a know GRUB2 bug. https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/1652822

I don't get it why I run into it after more than 3 years. Is this patch included in the Gentoo repository?
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 945
Location: Belgium

PostPosted: Sat Aug 08, 2020 3:18 pm    Post subject: Reply with quote

Seems to be nothing new: https://forums.gentoo.org/viewtopic-t-1097514-start-0.html

Is it possible to use the old Grub with UEFI?
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54300
Location: 56N 3W

PostPosted: Sat Aug 08, 2020 3:22 pm    Post subject: Reply with quote

Spanik,

No. The old grub makes BIOS calls to load bits of itself.
That fails when the BIOS isn't there.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1548
Location: South America

PostPosted: Sat Aug 08, 2020 4:02 pm    Post subject: Reply with quote

Spanik wrote:
So it looks like grub is setting / as read only. Why would it do that? And why does fstab not overrules that after boot.

That's GRUB2's default. OpenRC (if that's what you are using) should remount the rootfs read-write after doing the fsck. It is done by the root service (/etc/init.d/root). It's probably that (or the fsck step) what's failing.
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 945
Location: Belgium

PostPosted: Sat Aug 08, 2020 4:21 pm    Post subject: Reply with quote

GDH-gentoo wrote:
Spanik wrote:
So it looks like grub is setting / as read only. Why would it do that? And why does fstab not overrules that after boot.

That's GRUB2's default. OpenRC (if that's what you are using) should remount the rootfs read-write after doing the fsck. It is done by the root service (/etc/init.d/root). It's probably that (or the fsck step) what's failing.


I see that OpenRC is starting, after the dmesg on the screen I see this passing. But it is very fast gone. So I cannot read what is happening. Are these lines saved somewhere? I have a feeling what comes on the screen from OpenRC is also very short, I have an idea it should be longer. But at the moment it is just the kernel so that could be ok.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
DespLock
n00b
n00b


Joined: 27 Jul 2020
Posts: 65

PostPosted: Sat Aug 08, 2020 4:52 pm    Post subject: Reply with quote

I had the same issue a while ago.
Reason: i formatted my boot-/EFI-partition and forgot to change the UUID in fstab. Have you checked that the entry is correct?
Code:

blkid

EDIT: as long as root is ro, not all services will start.
You can try to remount your root with
Code:

mount -o remount,rw /
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1548
Location: South America

PostPosted: Sat Aug 08, 2020 6:42 pm    Post subject: Reply with quote

Spanik wrote:
I see that OpenRC is starting, after the dmesg on the screen I see this passing. But it is very fast gone. So I cannot read what is happening. Are these lines saved somewhere?

You can uncomment this line in /etc/rc.conf:
Code:
#rc_interactive="YES"

And reboot. You can then press the 'I' key any time after OpenRC started, to start services interactively one by one (or continue booting normally).

Or alternatively, uncomment these ones:
Code:
#rc_logger="NO"
[...]
#rc_log_path="/var/log/rc.log"
but change the pathname to e.g. /run/rc.log, because the default one will not work if /var is in the rootfs and / is read-only.

Of course, you won't be able to modify /etc/rc.conf while the rootfs is read-only; you can manually remount it read-write the way DespLock suggested.
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1016

PostPosted: Sat Aug 08, 2020 6:58 pm    Post subject: Reply with quote

Code:
/               xfs        noatime                   0 1


"noatime" seems to be a little bit mount option.Try to add "defaults" option.
see "mount" manual
Code:
man mount

Code:
defaults
              Use the default options: rw, suid, dev, exec, auto, nouser, and async.

              Note that the real set of all default mount options depends on kernel and filesystem type.  See the beginning of this section for more details.

For SSD drive(s) I suggest to add "discard" option also.

see "xfs" manual


I suggest :
/boot as FAT32 formatted filesystem where Kernels and Grub files a re installed ... you could have permisisions errors

If you need EFI

make EXT[3-4] filesystem for /boot
mkdir /boot/efi after mount of /boot

make FAT32 partition and mount /boot/efi into

install EFI into /boot/efi
Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi [...]


No need to mount /boot/efi in /etc/fstab once EFI is installed. (keep in mind if you must reinstall EFI for some reason , /boot/efi must be mounted)
BIOS check for FAT32 /EFI/blah/blah/firmware at boot ... Be sure to have GPT disklabel type. for EFI
_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 945
Location: Belgium

PostPosted: Sun Aug 09, 2020 9:18 am    Post subject: Reply with quote

Long post I'm afraid.

DespLock wrote:
I had the same issue a while ago.
Reason: i formatted my boot-/EFI-partition and forgot to change the UUID in fstab. Have you checked that the entry is correct?

Well, the UUID of /boot is correct in fstab. But if I try to mount it
Code:
(none) ~ # blkid /dev/nvme0n1p2
/dev/nvme0n1p2: SEC_TYPE="msdos" UUID="008E-3105" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="boot" PARTUUID="af5d23da-97e8-4ee7-9e99-864b7cffd077"
(none) ~ # mount /boot
mount: /boot: can't find UUID=008e-3105

So obviously there is something strange here.
GDH-gentoo wrote:
You can uncomment this line in /etc/rc.conf:
Code:
#rc_interactive="YES"

And reboot. You can then press the 'I' key any time after OpenRC started, to start services interactively one by one (or continue booting normally).

Did this and I now see that it gets to fsck, there are some red asterikses and then it drops me immediately in the login prompt.

I remounted / r/w and this gives no issues. So I guess that the fstab entry with UUID is ok. Tried putting the rc.log on /boot but this doesn't work either.

sabayonino wrote:
I suggest :
/boot as FAT32 formatted filesystem where Kernels and Grub files a re installed ... you could have permisisions errors

If you need EFI

make EXT[3-4] filesystem for /boot
mkdir /boot/efi after mount of /boot

make FAT32 partition and mount /boot/efi into

install EFI into /boot/efi
Code:
grub-install --target=x86_64-efi --efi-directory=/boot/efi [...]


No need to mount /boot/efi in /etc/fstab once EFI is installed. (keep in mind if you must reinstall EFI for some reason , /boot/efi must be mounted)
BIOS check for FAT32 /EFI/blah/blah/firmware at boot ... Be sure to have GPT disklabel type. for EFI

/boot is a vfat partition on a GTP disk. Likewise, grub-install has put the grubx64.efi in /boot/EFI/gentoo. So I think that is ok.

Slowly I'm thinking that the /boot UUID might be an issue.
_________________
Expert in non-working solutions
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 4236
Location: Bavaria

PostPosted: Sun Aug 09, 2020 10:36 am    Post subject: Reply with quote

Spanik wrote:
Slowly I'm thinking that the /boot UUID might be an issue.

Yes !
You must use PARTUUID instead of UUID in your fstab (or PARTLABEL; see my post here: https://forums.gentoo.org/viewtopic-t-1117254-highlight-.html)
Back to top
View user's profile Send private message
sabayonino
Veteran
Veteran


Joined: 03 Jan 2012
Posts: 1016

PostPosted: Sun Aug 09, 2020 10:57 am    Post subject: Reply with quote

Spanik wrote:

/boot is a vfat partition on a GTP disk. Likewise, grub-install has put the grubx64.efi in /boot/EFI/gentoo. So I think that is ok.

Slowly I'm thinking that the /boot UUID might be an issue.


I quoted myself
Quote:
/boot as FAT32 formatted filesystem where Kernels and Grub files are installed ... you could have permisisions errors


Where is your kernel image installed ? and where is grub directory installed ?

By default should be installed in /boot
_________________
LRS i586 on G.Drive
LRS x86-64 EFI on MEGA
Back to top
View user's profile Send private message
Spanik
l33t
l33t


Joined: 12 Dec 2003
Posts: 945
Location: Belgium

PostPosted: Sun Aug 09, 2020 11:46 am    Post subject: Reply with quote

pietinger wrote:
Spanik wrote:
Slowly I'm thinking that the /boot UUID might be an issue.

Yes !
You must use PARTUUID instead of UUID in your fstab (or PARTLABEL; see my post here: https://forums.gentoo.org/viewtopic-t-1117254-highlight-.html)


YES, that did it. I changed the entry for /boot in fstab to use PARTUUID instead of UUID and now it boots into a regular promt and / is mounted r/w.

Thanks to all that helped, I did learn a few things this time.
_________________
Expert in non-working solutions
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