Can't log in after having mounted a formatted USB flash drive as /home

Hello everyone,

I made a mistake: I mounted a USB flash drive as the /home partition just after having formatted it.
As a result, when I boot my laptop, I’m unable to log in (the log in screen pops up again a few seconds later).
I can access the rescue mode and use my password to get to the superuser though.

I’m looking for a way to solve my problem (I suspect the partition table needs to be remapped), could anyone help me please?

Thank you a lot,

G.

Change /etc/fstab to point to your original /home file system instead of to the file system on the flash device.

thank you for your answer.
This is what I get when I try to edit /etc/fstab.

Imagepipe_188|690x134

It seems the file doesn’t point to any /home file system while for the other partitions the file points to a subvolume.
Should I add an entry for the home partition and/or delete the subvol= part of every other partition?

First, when you have to communicate am image, please either just paste it into your post or upload it to https://paste.opensuse.org/

It seems that your description is not precise enough. What exactly did you do?

Tumbleweed nowadays installs by default with /home being part of the root file system /. It also uses by default Btrfs as file system for /. And, I am not sure about this, has /home as a subvolume there.

Now how did you mount the file system on that flash device as /home? When you did that manually, it would have been undone after a shutdown. Thus I really do not understand the whole sequence of actions.

al\Also is the new FS a Linux file system or a Windows

In all cases a mounted fresh and thus empty file system on /home would make login impossible.

Sorry, I didn’t know how to post an image.
This is the sequence I followed as I remember it (I did it last week, I apologize if I forget anything):

In Yast Partitioner, I selected /dev/sdb1 (which was the main partition of my USB key) and formatted it.
I think I formatted it three or four times in a row because each time I tried to open the new partition on my device to paste some files I couldn’t and got an error (don’t remember which one).

I also remember having changed the format, I think I chose Btrfs and Fat. Unfortunately I don’t remember which format I chose when I mounted the USB key as /home (I gave this option a try thinking that’d allow me to access my device.)

Thank you for your help!

given the whole sequence of actions I followed, it could be a Windows one (FAT) as well.

It an only be one type, not as well as Btrfs as FAT.

It seems that you can not provide much information. Maybe we can find out some of the question marks here.
The problem is that you do not have a desktop, thus copy/paste of output is difficult. But you can still use paste/opensuse. That works as follows. Pipe the output of a command to susepaste and you will then get an URL which you can post here.

First question: are there any error messages during boot? You can see the messages by using the Esc key during boot.

Then login as root and find out what is mounted:

mount | susepaste -e  40320

show what mass-storage you have (with the stick connected):

fdisk -l | susepaste -e 40320

and

lsblk -f | susepaste -e 40320

and show what is in /home

ls -l /home | susepaste -e 40320

I chose FAT first and Btrfs secondly, while I was trying to understand I couldn’t mount the device I’ve just formatted (I formatted the USB key three or four times to find a solution).

I could go through the files of my OpenSuse system using a USB flash device. It appears the home folder is empty while I could find various files in /usr/share including of software I installed lately.

  1. I couldn’t find any error during boot. Straight after I press enter to log in and just before the login screen appears, I get
Starting libvirt QEMU daemon...
Starting X Display Manager...
Starting Hold until boot process finishes up

Welcome to openSUSE Tumbleweed20250727 - Kernel 6.15.8-1-default (tty1).

enp0s31f6:
wlp2s0:


Welcome to openSUSE Tumbleweed20250727 - Kernel 6.15.8-1-default (tty1).

enp0s31f6:
wlp2s0:

I’ll post the output of the commands in a couple of minutes.

  1. When I boot into recovery mode, I’ve got several error messages though.

https://paste.opensuse.org/pastes/d740635c7b0b

I’m really sorry but although I managed to connect a WiFI network through terminal, I can’t susepaste as requested.
I tried to shoot the best photos I could, hoping they’re clear enough to read.
Apologies.

fdisk -l | susepaste -e 40320

https://paste.opensuse.org/pastes/14654d669fc2

lsblk -f | susepaste -e 40320

https://paste.opensuse.org/pastes/51f7fee65e8e

ls -l /home | susepaste -e 40320

https://paste.opensuse.org/pastes/51fd0fc56513

From your photos I see that:

  • /home is empty, no wonder you cannot login as a user different from ‘root’
  • the nvme disk has the root filesystem mounted, but there is no /home in it;
  • there is an install media connected as sda, no other usb disk space available to be mounted as /home.
    So either a second usb drive is not visible or the one with the install media has not be re formatted to be used as /home.

I mostly concur with @OrsoBruno .

I really can not imagine what you did. But /dev/sda has an EFI partition and an ISO file system, which in total is the openSUSE Tumbleweed installation system from 2025-08-20. Thus I doubt very very much that you “formatted” something there.

On nvme01 there are 4 partitions:

  1. an EFI partition
  2. with an ext4 file system, with is not mounted at that moment, could that be your original /home?
  3. with your Btrfs root file system
  4. swap

And there is no content in /home. Best is to restore all data there from your backup.

Please next time when you start experimenting, make notes!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.