You are not logged in.

#1 2019-06-27 13:20:51

m1z3
Member
Registered: 2019-06-27
Posts: 2

genfstab generated wrong configuration for /etc/fstab?

Hello!

I have doubts about

genfstab -U

generated information. My goal was to create 4 partitions:

  1. /dev/sda1 - /boot

  2. /dev/sda2 - SWAP

  3. /dev/sda3 - /

  4. /dev/sda4 - /home

I thought that

genfstab -U /mnt >> /etc/fstab

will produce four entries to /etc/fstab, but it only produced two:

# /dev/sda3
UUID=c778fbb1-5dfc-4e7d-b018-13e7c73c30b1	/         	ext4      	rw,relatime	0 1

# /dev/sda2
UUID=6eacfe29-a167-4961-95c7-51bbe9becb26	none      	swap      	defaults  	0 0

Here are some info:

lsblk -f
sda                                                                       
├─sda1 ext4           74d72fb5-9d5e-45fc-89e9-3f9f3e0482c4                
├─sda2 swap           6eacfe29-a167-4961-95c7-51bbe9becb26                [SWAP]
├─sda3 ext4           c778fbb1-5dfc-4e7d-b018-13e7c73c30b1   64.5G    29% /
└─sda4 ext4           959dc7b4-eb35-4903-998d-95058aefcfbc
sudo fdisk -l
Disk /dev/sda: 238.49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: SSD0256XQC82X200
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x2429fadf

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1            2048    411647    409600   200M 83 Linux
/dev/sda2          411648  17188863  16777216     8G 83 Linux
/dev/sda3        17188864 224880639 207691776    99G 83 Linux
/dev/sda4       224880640 500117503 275236864 131.2G 83 Linux

I've tried to add the /dev/sda1 and /dev/sda4 manually, but when I tried to login to my account, system couldn't boot. Should I leave the /etc/fstab as it is or am I supposed to put /dev/sda1 and /dev/sda4 entries in /etc/fstab in some particular order? Thanks!

Edit 1: spelling
Edit 2: missing parameter in genfstab

Last edited by m1z3 (2019-06-27 13:47:40)

Offline

#2 2019-06-27 13:42:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,423

Re: genfstab generated wrong configuration for /etc/fstab?

genfstab uses the mounting table to generate entries, if your partitions in question were not actually mounted at that point in time it will not add entries for them.

You can always add entries manually in any case. The root partition should come first the others don't matter as much, you should elaborate on what "couldn't boot" means when adding them manually. Which boot loader do you use? If that is configured to load files from the /boot partition (as opposed to the /boot directory on your root partition as is now likely the case...) or vice versa that could introduce issues (FWIW why do you have a separate boot partition in the first place? If you don't really need one you could save yourself some potential confusion)

The focus should be on what "system doesn't boot" means exactly, do you get error messages when selecting the entry, does the system not progress? can you read your journal for the failure cause

sudo journalctl -b #If you had to reboot due to an error maybe use -b-1 for the previous boot

Offline

#3 2019-06-27 14:06:09

m1z3
Member
Registered: 2019-06-27
Posts: 2

Re: genfstab generated wrong configuration for /etc/fstab?

While installing ArchLinux, when it comes to configuration the system I did as what it says:

# genfstab -U /mnt >> /mnt/etc/fstab

and this command generated two entries mentioned above. You're right about the /boot partition, I shouldn't have create one. That's one issue, one to go - /home partition. Here is my journal.

Edit 1: I'm using GRUB

Last edited by m1z3 (2019-06-27 14:06:42)

Offline

#4 2019-06-27 14:47:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,423

Re: genfstab generated wrong configuration for /etc/fstab?

And that command would do what you expect, granted you had mounted your intended home and boot partitions in /mnt/home and /mnt/boot respectively, before executing that command, which I'm assuming wasn't the case.

Jun 27 14:36:58 unknown systemd[1]: boot.mount: Directory /boot to mount over is not empty, mounting anyway.
Jun 27 14:36:58 unknown systemd[1]: Mounting /boot...
Jun 27 14:36:58 unknown systemd[1]: Started File System Check on /dev/disk/by-uuid/959dc7b4-eb35-4903-998d-95058aefcfbc.
Jun 27 14:36:58 unknown systemd[1]: home.mount: Directory /home to mount over is not empty, mounting anyway.
Jun 27 14:36:58 unknown systemd[1]: Mounting /home...
Jun 27 14:36:58 unknown systemd[1]: Mounted /boot.

Pretty much confirms our assumption. There are relevant directories already present that you now mount over. If you didn't actively update your kernel or similar between these attempted /boot overrides after you've actually mounted the /boot "partition" it should be empty, if you unmount it the /boot "directory" should contain the kernel and your GRUB configuration (which will likely be configured to boot from your root partition), so either forget about the /boot partition or move the contents of the /boot "directory" to the actual partition (mount it temporarily in /mnt or so, move/copy contents, (re)move the directory, remount the parititon to the correct /boot location  and regenerate your GRUB config and fix fstab)  do the same for the /home partition (that care to do that with the correct user permissions, start with

cp --preserve=all

to be sure)

FWIW what I'm also seeing and suspecting to be the actual cause for why you think you aren't progressing is

Jun 27 14:37:06 unknown kernel: random: crng init done

a full 10 seconds after initial request so you might also want to install and enable haveged.

Also in general a few weird things happening, is the hostname 'unknown' a known and active decision on your part? You might want to set a proper hostname if not. Which graphical session are you starting?

Last edited by V1del (2019-06-27 14:48:36)

Offline

Board footer

Powered by FluxBB