You are not logged in.

#1 2014-09-30 16:43:41

ingegnue
Member
Registered: 2014-06-01
Posts: 15

[SOLVED] emergency mode after repartitioning and reinstalling GRUB.

I used to have the following partitions:

sda1 -- 4GB   -- swap -- swap
sda2 -- 15GB -- ext3 -- Arch
sda3 -- 15GB -- ext3 -- Trisquel
sda4 -- the rest -- ext4 -- /home folder at /mnt/home *shared mount point but different usernames*
sda5 -- 5MB  -- bios_grub

Then after I discovered, upon toying with my GRUB configuration, that the lead developer of Trisquel (based off of Ubuntu) made it so that a random password is generated for GRUB[1], to restrict access to the e and c options in the grub menu. I removed the password, but, frustrated by this and uncertain whether some other options were changed that I don't know about, I decided to remove Trisquel for the moment.

Caveat: I read the latest GRUB manual, the Arch GRUB Wiki entry, and the Ubuntu GRUB wiki entry, as well as scoured the net for about a day. But I only know a tiny bit about scripts, and I am not terribly experienced with GRUB.

The issue is that GRUB was installed on the sda3 partition during the install process (I installed Arch later on), and so any time I needed to edit the configuration, I had to boot into Trisquel. But since deleting that partition would also delete GRUB, I would have to go about installing GRUB again, so Arch could boot.

Oh well. So I backed up my data and edited my partition table with gdisk in an Arch LiveDVD dated 08.01.2014 to the following:

sda1 -- 4GB   -- swap -- swap
sda2 -- 15GB -- ext3 -- Arch
sda3 -- 100GB -- ext4 -- Data (no mount, to be shared with other distros)
~free space~
sda4 -- 1.2MB -- EF02 -- bios_grub boot partition at end of usable space

Then I proceeded to install GRUB[2][3]:
# mount -t ext3 /dev/sda2 /mnt
# arch-chroot /mnt
# grub-install --target=i386-pc --recheck --debug /dev/sda
Installation finished, no errors reported.
# grub-mkconfig -o /boot/grub/grub.cfg
It found 3 kernels: regular, lts (which I had installed previously), and fallback.
# exit
exiting chroot.
# reboot
eject disk, select HDD to boot

OMG hai Arch Linux grub menu!
"Arch: clean, x files, x blocks"
*is greeted by red stars moving back and forth, progress: 1/3, 1 min 30s* "A start job is running for..."

Then I got these errors:
[TIME] Timed out waiting for device sys-subsystem-net-devices-eth0.device.
[DEPEND] Dependency failed for dhcpcd on eth0.
[TIME] Timed out waiting for device dev-disk-by\x2duuid-xxxxxxxx\xxxxxxx\xxxxxxx\xxxxxxx\xxxxxxxxxxxxxxx.device
[DEPEND] Dependency failed for /home.
[DEPEND] Dependency failed for Local File Systems.
[DEPEND] Dependency failed for File System Check on /dev/disk/by-uuid/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
[TIME] Timed out waiting for device sys-subsystem-net-devices-wlan0.device.

and...

*stopping and starting a bunch of processes*
"Welcome to emergency mode! ... Give root password for maintenance (or press Control-D to continue):

I mean, I figured my system would complain for me deleting /home, but I didn't expect this big_smile
In retrospect, I suppose I should have moved  my user's home folder first... But I just figured I would create a new user, and root wouldn't be affected.

So, first question: why am I in the emergency mode?
Excuse me while I brainstorm answers.
Is it something to do with deleting the mounted /home partition?
Is it something to do with using a 1-2 months-old rescue disk?
Is it as simple as pacmatic -Syu to update GRUB?
Is it as simple as creating a new user with a home folder on /dev/sda2 and deleting the old user?
Do I simply need to move the location of the home folder for that user?
Is root being affected or is it just my basic user?
Did I mess up the partitioning bit?
Should I abort all my currently installed packages, bring it back to core, and reinstall needed ones?
Did I mess up the chroot?
What do those error messages mean?

I don't have a clue. I'm afraid to touch it because I don't want to break it any further big_smile

[1] https://trisquel.info/en/forum/unable-b … el-60-grub
[2] https://fasterland.net/reinstall-grub-arch-linux.html
[3] https://wiki.archlinux.org/index.php/Grub

Last edited by ingegnue (2014-10-01 15:45:02)

Offline

#2 2014-10-01 15:43:35

ingegnue
Member
Registered: 2014-06-01
Posts: 15

Re: [SOLVED] emergency mode after repartitioning and reinstalling GRUB.

I realize that the boot is failing at the init stage[1].

Observing this behavior, I realize that it's something to do with systemd. Emergency mode is a feature of Systemd.[2]

Systemd was trying to start some processes, but they failed to start because some timed out and some lacked their dependencies. I guess the "A start job is running for..." is an indication that the process is stalling during init and Systemd is trying to jump start it, or something like that.

And I am coming to realize that the error messages are saying something is wrong with /home, ethernet, and wireless.

This thread[3], as well as the one linked in it, has given me a clue. Systemd fails when fstab can't detect a partition it expects.

My research tells me it is common to drop into emergency mode after an issue with fstab.[2] After editing, I should "run systemctl daemon-reload to let systemd refresh its view of it."

Which of course leads me to the Arch fstab wiki entry, as well as the manual.

This is the output of cat /etc/fstab

# <file system> <dir> <type> <options><dump><pass>
/dev/sda2 LABEL=Arch
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx     /     ext3     rw,relatime,data=ordered     0 1

# /dev/sda4 LABEL=homefolder
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx     /home     ext4     rw,relatime,data=ordered     0 2

# /dev/sda1
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx none     swap     defaults     0 0

And /home is still on /dev/sda4 in my /etc/fstab. So perhaps I'll remove /home from fstab and call it good.

Edited with nano and removed the second line. Then systemctl daemon-reload. Reboot.

Getty started! big_smile

Marking this as solved.

[1] https://wiki.archlinux.org/index.php/Arch_Boot_Process
[2] http://freedesktop.org/wiki/Software/systemd/Debugging/
[3] https://bbs.archlinux.org/viewtopic.php … 4#p1198194

Last edited by ingegnue (2014-10-01 16:28:12)

Offline

Board footer

Powered by FluxBB