Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
/etc/group trashed on bootup
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
eflothmeier
n00b
n00b


Joined: 20 Sep 2014
Posts: 58
Location: Tucson, AZ

PostPosted: Sun Sep 27, 2015 3:44 am    Post subject: /etc/group trashed on bootup Reply with quote

Problem: /etc/group file is altered on /dev/sda4 when
bootup is attempted (machine halts with black
screen)

Here's my emerge --info
Code:

(chroot) livecd etc # emerge --info
portage: 'portage' user or group missing.
         For the defaults, line 1 goes into passwd, and 2 into group.
         portage:x:250:250:portage:/var/tmp/portage:/bin/false
         portage::250:portage
*** WARNING ***  For security reasons, only system administrators
should be
*** WARNING ***  allowed in the portage group.  Untrusted users or
processes
*** WARNING ***  can potentially exploit the portage group for attacks
such as
*** WARNING ***  local privilege escalation.

Portage 2.2.20.1 (python 2.7.9-final-0,
default/linux/x86/13.0/desktop/gnome/systemd, gcc-4.8.4,
glibc-2.20-r2, 3.15.6-aufs i686)
=================================================================
System uname: Linux-3.15.6-aufs-i686-Intel-R-_Core-TM-2_Quad_CPU_Q9550_@_2.83GHz-with-gentoo-2.2
KiB Mem:     3363084 total,   1826472 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 25 Sep 2015 03:30:01 +0000
sh bash 4.3_p39

ld GNU ld (Gentoo 2.24 p1.4) 2.24
app-shells/bash:          4.3_p39::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.9-r1::gentoo, 3.3.5-r1::gentoo,
3.4.1::gentoo
dev-util/cmake:           3.2.2::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.17::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.24-r3::gentoo
sys-devel/gcc:            4.8.4::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.20-r2::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
CCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=i686 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d
/etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d
/etc/terminfo"
CXXFLAGS="-O2 -march=i686 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified
distlocks ebuild-locks fsandbox sfperms strict unknown-features-warn
unmerge-logs unmerge-orphans userfetch user
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="http://ftp.ucsb.edu/pub/mirrors/linux/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times
--omit-dir-times --eout=180 --exclude=/distfiles --exclude=/local
--exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa berkdb bindist bluetooth branding bzip2
cairo cdda cdr cli e evo exif fam firefox flac fortran gdbm gif glamor
gnome gnome-keyring gnome-online-acctify libsecret mad mng modules mp3
mp4 mpeg nautilus ncurses nls nptl ogg opengl openmp comp session
spell ssl startup-notification svg systemd tcpd tiff tracker truetype
udev lib" ABI_X86="32" ALSA_CARDS="hd_intel"
APACHE2_MODULES="authn_core authz_core socache_sauthn_default
authn_file authz_dbm authz_default authz_groupfile authz_host
authz_owner isk_cache env expires ext_filter file_cache filter headers
include info log_config logios unique_id userdir usertrack
vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheet_PLUGINS="df
interface irq load memory rrdtool swap syslog" ELIBC="glibc"
GPSD_PROTOCOLSax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore
rtcm104v2 rtcm104v3 sirf superse evdev" KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001
mer-minimizer" OFFICE_IMPLEMENTATION="libreoffice"
PHP_TARGETS="php5-5" PYTHON_SINGLE_TARby20 ruby21" USERLAND="GNU"
VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan t sysrq
steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK,
LC_ALL, PORTAGE_BNC_EXTRA_OPTS, USE_PYTHON



Here's my fstab

Code:

<fs>                  <mountpoint>    <type>          <opts>
<dump/pass>

# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
/dev/sda2               /boot           ext2            noauto,noatime  0 2
/dev/sda4               /               jfs             noatime         0 1
/dev/sda3               none            swap            sw              0 0
/dev/sdb1               /mnt/sdb_drive  jfs             noatime         0 1
#/dev/cdrom             /mnt/cdrom      auto            noauto,ro       0 0
/dev/fd0                /mnt/floppy     auto            noauto          0 0



Any emerge command will have that portage warning
because of the missing line in /etc/group
How does /etc/group get set up in the first place?
I assume there is some generic form of it in
the stage3 tarball.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sun Sep 27, 2015 9:23 am    Post subject: Reply with quote

eflothmeier,

Yes, there is an /etc/group is the stage3.
Its modified by portage whenever you add a package that needs its own group, like apache.
Its modified by the root user using groupadd, groupmod, useradd, usermod and so on.

You can also edit /etc/group with $EDITOR, which is a very bad thing, as you don't get the systax checking provided by the commands.
The commands also save the pre change group file as /etc/group~.
_________________
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
eflothmeier
n00b
n00b


Joined: 20 Sep 2014
Posts: 58
Location: Tucson, AZ

PostPosted: Sun Sep 27, 2015 9:10 pm    Post subject: Reply with quote

Hmmm

Interestingly enough /etc/passwd
remains intact.

I tried to keep this installation as simple as
possible. I have ignored INITRAMFS
and RAID instructions. It's just supposed
to boot from the /dev/sda drive.

I haven't touched the /etc/group file
since last bootup attempt, but there's
just garbage in it anyway.
Back to top
View user's profile Send private message
Buffoon
Veteran
Veteran


Joined: 17 Jun 2015
Posts: 1074
Location: EU or US

PostPosted: Sun Sep 27, 2015 10:56 pm    Post subject: Reply with quote

Is the backup file trashed, too?
Back to top
View user's profile Send private message
eflothmeier
n00b
n00b


Joined: 20 Sep 2014
Posts: 58
Location: Tucson, AZ

PostPosted: Wed Sep 30, 2015 2:48 am    Post subject: Reply with quote

Yes

group- is garbagey too, and the garbage in group hasn't
been copied to group-

I've looked on another machine's group/group- I discovered
they're not exact duplicates of one another, but pretty close.
Back to top
View user's profile Send private message
eflothmeier
n00b
n00b


Joined: 20 Sep 2014
Posts: 58
Location: Tucson, AZ

PostPosted: Wed Sep 30, 2015 5:45 am    Post subject: Reply with quote

Changed the
/etc/default/grub file
and rebooted w/o live cd

Once again the bootup stopped with a blank
screen.

Rebooted with live cd

Got back into /dev/sda4
and looked at /etc/group

This time there was something more sensible:

Code:

(chroot) livecd etc # cat group
disk:x:985:
cdrom:x:994:
users:x:992:
dialout:x:989:
lp:x:996:
wheel:x:993:
audio:x:999:
video:x:991:
adm:x:995:
input:x:987:
systemd-timesync:x:979:
tape:x:998:
root:x:982:
utmp:x:997:
lock:x:984:
tty:x:986:
kmem:x:988:
systemd-journal:x:990:
systemd-bus-proxy:x:981:
nobody:x:978:
systemd-network:x:980:
systemd-resolve:x:983:

However
The system will still complain because
the critical items:
Code:

root:x:0:root
portage:x:250:portage

are missing

At this point I need to show that changing
/etc/default/grub caused /etc/group to
populate somhow. Stay tuned
Back to top
View user's profile Send private message
eflothmeier
n00b
n00b


Joined: 20 Sep 2014
Posts: 58
Location: Tucson, AZ

PostPosted: Thu Oct 22, 2015 12:49 am    Post subject: Reply with quote

We're back to our investigation
(Intervening travel to see a family member's wedding took place)

It's inconclusive. Putting /etc/default/grub back the way it
was didn't cause the garbage in /etc/group to come back.

/etc/default/grub snippet now looks like this:
Code:

(chroot) livecd default # cat grub
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
#
# To populate all changes in this file you need to regenerate your
# grub configuration file afterwards:
#     'grub2-mkconfig -o /boot/grub/grub.cfg'
#
# See the grub info page for documentation on possible variables and
# their associated values.

GRUB_DISTRIBUTOR="Gentoo"

# Default menu entry
GRUB_DEFAULT=0

# Boot the default entry this many seconds after the menu is displayed
#GRUB_TIMEOUT=10
#GRUB_TIMEOUT_STYLE=menu

# Append parameters to the linux kernel command line
#GRUB_CMDLINE_LINUX=""
#
# Examples:
#
# Boot with network interface renaming disabled
# GRUB_CMDLINE_LINUX="net.ifnames=0"
#
# Boot with systemd instead of sysvinit (openrc)
GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"
.
.

.

Just on a hunch. I decided to uncomment the
line:
GRUB_DEFAULT=0



/etc/group
now looks like this:


Code:

(chroot) livecd etc # cat group
disk:x:985:
cdrom:x:994:
users:x:992:
dialout:x:989:
lp:x:996:
wheel:x:993:
audio:x:999:
video:x:991:
adm:x:995:
input:x:987:
systemd-timesync:x:979:
tape:x:998:
root:x:0:root
utmp:x:997:
lock:x:984:
tty:x:986:
kmem:x:988:
portage:x:250:portage
systemd-journal:x:990:
systemd-bus-proxy:x:981:
nobody:x:978:
systemd-network:x:980:
systemd-resolve:x:983:



The "portage" and "root" lines were added/modified.
This is bad practise, but at least the system isn't
displaying goofy ls -l listings or emerge warnings.


We still can't explain why /dev/ext4 returns a mount
error, and that may be the key. On bootup, if /dev/ext4
becomes unmountable, that's a show stopper.
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Fri Oct 23, 2015 1:18 pm    Post subject: Reply with quote

It sounds much more like a drive hardware or driver problem than an emerge problem.
Try booting off a rescue cd and running fsck on the root partition.

Will
Back to top
View user's profile Send private message
eflothmeier
n00b
n00b


Joined: 20 Sep 2014
Posts: 58
Location: Tucson, AZ

PostPosted: Sat Oct 24, 2015 4:50 am    Post subject: Reply with quote

OK

I've decided to stop using /etc/default/grub to
pick up systemd and use the kernel instead. I
did a reconfigure of
Code:

Processor type and features -->
   built-in kernel command line


now has:

Code:

   "init=/usr/lib/systemd/systemd"


I now see my grub2 menu and select:

as a result the screen still goes blank, but
before it does I see kernel time-stamped
boot-up lines running up the screen.

It just sits there with a blank screen so
I stop it and boot up with the liveDVD

This time I have no trouble mounting
/dev/sda4

I look at the /var/log/journal directory
and discover systemd is trying to tell me
something.

Code:

(chroot) livecd 08eb9133c250775b2c5234b255f35c36 # pwd
/var/log/journal/08eb9133c250775b2c5234b255f35c36
(chroot) livecd 08eb9133c250775b2c5234b255f35c36 # ls -l
total 65540
-rw-r----- 1 root root            8388608 Sep 25 05:17
system@000520915694c71f-f37c24aa95f4414d.journal~
-rw-r----- 1 root root            8388608 Sep 26 16:14
system@000520aea1340fc2-e85ef59eed6b1ae7.journal~
-rw-r----- 1 root root            8388608 Sep 29 21:49
system@000520efa96fcc8e-656453f387028a62.journal~
-rw-r----- 1 root root            8388608 Oct 12 13:52
system@000521ee811a633c-4eb6b99f009204b5.journal~
-rw-r----- 1 root systemd-journal 8388608 Oct 21 16:12
system@000522a5835e01c6-88a0b9c7c31f80f6.journal~
-rw-r----- 1 root systemd-journal 8388608 Oct 21 19:30
system@000522a8486c984c-f19bf2558871bf0d.journal~
-rw-r----- 1 root systemd-journal 8388608 Oct 23 13:32
system@000522cb84468800-6bb512eda84c9044.journal~
-rw-r----- 1 root systemd-journal 8388608 Oct 23 20:07 system.journal


First of all, things are getting written
to /dev/sda4 That's a recent time stamp.

system.journal
is in machine code and probably can be read by
some systemd command. Unforunately, I'm in
an OpenRC world now. So lots of fun.
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