You are in emergency mode after logging - Failed to start default target transaction for graphical.target/start is destructive

Hello everyone, when I started my Dell Optiplex 3050 computer with Ubuntu yesterday, the following error was displayed and I don’t really know what to do to fix this incident and make the PC start normally again:

You are in emergency mode. After logging in, type "journalctl -xb" to view system logs, "systemctl reboot", "systemctl default" or "exit"
to boot into default mode.
Press enter for maintenance
or press Control-D to continue. 

and

Failed to start default target transaction for graphical.target/start is destructive (emergency.target has ‘start’ job queued, but ‘stop’ is included in transaction)

I read a lot of dedicated topics in the forums. And here is what I did before shutting down my PC when it was still working:

  • Connecting a Windows NFTS external drive containing movies to my Ubuntu PC

  • Downloading a movie that did not work due to lack of space on the hard drive. The goal was to download the movie from my Ubuntu PC and copy it to the external drive but I did not pay attention to the remaining space on the PC hard drive.

  • For several days, an Ubuntu update was proposed but I never installed it

I changed my screen (1920x1080) to a 4K UHD screen and when changing the screen, I did not notice anything special. I reconnected the PC to the old screen but the error is still there. I use this new screen for the Ubuntu PC and for other things like a game console.

Following my readings, I managed to delete the “*.part” file of the film and took the opportunity to empty the recycle bin, so it is no longer a space problem.

The external drive is no longer connected and I read that you have to manipulate the FSTAB file in the event of an incident of this type. I read that some people renamed the disk name UUID=0000-0000 to something else but I don’t know if that could correct the incident.

I read the logs and there are lines in white, orange and red. Here are the ones in red:

I tried the command line fsck -y /dev/sda1but it doesn’t seem to work

My hard drive is encrypted with a pre-login password at boot time that is normally required, which allowed me to get the error message and view the logs. I don’t know what would happen if I used a bootable USB stick with Ubuntu on it to fix the problem: would I be able to access the data on the drive with the ability to enter the decryption password?

Other information that may be useful:

Thanks for reading and for your patience with those new to Ubuntu.

Yes, you certainly should be able to decrypt the volume and access your data during a live “Try Ubuntu” session.
While you are in a live environment, take the opportunity to backup your personal data.

Thank you tea-for-one, I will try to create a live USB and recover my data.

Hello, I managed to create a live USB drive and I managed to mount the rpool but I can’t access it. I can however list the contents of the disk because I was able to enter the decryption key. ZFS is supported. I don’t see how to access the data via file explorer because I get an error message. Have you ever encountered this incident?

Is there any risk in using zpool upgrade?

Thank you







I’m not seeing any bpool listed.
Was you able to get anything you wanted backed up?

 zpool status
  pool: bpool
 state: ONLINE
config:

	NAME                                                   STATE     READ WRITE CKSUM
	bpool                                                  ONLINE       0     0     0
	  ata-SKHynix_HFS512GDE9X084N_CYB7N014910507D2T-part2  ONLINE       0     0     0

errors: No known data errors

  pool: rpool
 state: ONLINE
config:

	NAME                                                   STATE     READ WRITE CKSUM
	rpool                                                  ONLINE       0     0     0
	  ata-SKHynix_HFS512GDE9X084N_CYB7N014910507D2T-part4  ONLINE       0     0     0

errors: No known data errors

  pool: tank
 state: ONLINE
config:

	NAME        STATE     READ WRITE CKSUM
	tank        ONLINE       0     0     0
	  sda1      ONLINE       0     0     0

errors: No known data errors

The bpool shows as /dev/sda4 on your system. And that is how it boots. with out a valid bpool there is no boot.

Ok just re-read your post to mount your “rpool” you will need in your Live installer these to import your rpool.

zfsutils-linux

Thank you, I started over and rebooted with my USB stick. I imported both pools but I still get the error message that I can’t open: “[…] Member not configured in Kernel”


I’ll try again tomorrow because I’ve been on it for several hours today. Thank you for your help.

yep you have to import the rpool from your USB installer:

sudo zpool import -f rpool

The “f” flag will be needed because it was accessed by your older system.

CLI can be used to transfer any needed data to another drive.
Example only, for your entire /home/user

sudo cp -a /home/$USER /your/backup/drive

That should make sense for any other locations you need to back-up as well.

And if you are able to fix it, don’t forget to export it when done.
If you can’t fix it then there is no real need to export it.

Good Luck
BTW Welcome to Discourse.

1fallen, thank you for your welcome message.

I tried the command line but after running it an error message appeared:

ValueError : invalid dep_id (disk-zd0) not in storage config


31

I took pictures of the entire error report, there are about ten of them, I don’t know if they are all useful for the analysis.
Then after entering the command line, the /dev/zd0 partition appeared and I entered my decryption password and indicated the same password for the “Default Keyring” page :



I installed a USB stick to try to see if the second command line was possible. The command line exited but I don’t know if it worked.

Did you look in the drive you sent it to?
It would be in a Folder with your user name and not USER.

I personally would not do that until the other issues are ironed out first. Now I’ll go back to lurking and let @1fallen help you.

Ok I just did this from my Arch ZFS:

zpool status
  pool: tank
 state: ONLINE
config:

        NAME         STATE     READ WRITE CKSUM
        tank         ONLINE       0     0     0
          /dev/sda1  ONLINE       0     0     0

errors: No known data errors

  pool: zpcachyos
 state: ONLINE
config:

        NAME                                                          STATE     READ WRITE CKSUM
        zpcachyos                                                     ONLINE       0     0     0
          /dev/disk/by-partuuid/4592461a-b016-487c-bef0-39dd93e34c5c  ONLINE       0     0     0

errors: No known data errors


I used the very comands I suggested, first by importing the “rpool” then the copy command:
sudo cp -a /home/USER /tank/

Then I verify the copy completed correctly:

cd /tank/me && less .bash_history

Just a short snip, but arch does not use “apt” so yes my copy ran as expected.

sudo apt install auditd
auditctl -e0
sudo auditctl -e0
sudo nano /etc/hosts
sudo apt install qt5ct qt6ct strawberry qbittorent firejail fire-tools
sudo apt install qt5ct qt6ct strawberry qbittorrent firejail fire-tools

Also I agree with @sgt-mike

Thank you 1fallen and sgt-mike,

I re-ran the command with an 8TB hard drive formatted in linux ext4 file format that can accommodate the backup of the 2TB internal drive. Unfortunately, the data copied is that which comes from the Ubuntu version of the USB key and not from the internal hard drive. There is probably a step that I am doing wrong or do not understand.

Steps:

  1. First command line:
    sudo zpool import -f rpool

  2. A window appears indicating that there was a problem (as on the previous screen prints)

  3. Connect to the rpool partition to write the decryption password.

  4. Second command line:

sudo cp -a /home/$USER /media/ubuntu/test



There is a folder that is created (like the first time that I had not checked), but it is named “ubuntu”

Ok I see you need to “cd” or Change Directory to your current rpool.
Maybe have a look with:

Please try and copy input from the terminal back here to see or view.
Screenshots are not always readable…:smiley:
Better yet use this:

sudo fdisk -l

I’m going to be away for the rest of the day.

Hi1fallen, thanks for the quick reply. I apologize for the delay in my response. Here is the output of the command

sudo fdisk -l

after a reboot without writing the following command lines

sudo zpool import -f rpool
sudo cp -a /home/$USER /media/ubuntu/test

=> 

ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/loop0: 1.63 GiB, 1752752128 bytes, 3423344 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 471.01 MiB, 493887488 bytes, 964624 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 874.37 MiB, 916840448 bytes, 1790704 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 4 KiB, 4096 bytes, 8 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 10.72 MiB, 11239424 bytes, 21952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 269.77 MiB, 282873856 bytes, 552488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 74.27 MiB, 77881344 bytes, 152112 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 505.09 MiB, 529625088 bytes, 1034424 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 1.82 TiB, 2000398934016 bytes, 3907029168 sectors
Disk model: CT2000MX500SSD1 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: AB335AE9-3488-4382-BCE4-09EFB3DD507F

Device       Start        End    Sectors  Size Type
/dev/sda1     2048       4095       2048    1M BIOS boot
/dev/sda2     4096    1054719    1050624  513M EFI System
/dev/sda3  1054720    5249023    4194304    2G Linux swap
/dev/sda4  5249024    9443327    4194304    2G Solaris boot
/dev/sda5  9443328 3907029134 3897585807  1.8T Solaris root


Disk /dev/sdd: 14.72 GiB, 15806234624 bytes, 30871552 sectors
Disk model: Transcend 16GB  
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: 0x0088c5ea

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdd1  *     2048 30871535 30869488 14.7G  c W95 FAT32 (LBA)


Disk /dev/sdb: 7.28 TiB, 8001563222016 bytes, 15628053168 sectors
Disk model: ASM1156-PM      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 3F47373B-4A55-40F7-BE91-FBAA265A4BE5

Device     Start         End     Sectors  Size Type
/dev/sdb1     34       32767       32734   16M Microsoft reserved
/dev/sdb2  32768 15628052479 15628019712  7.3T Linux filesystem

Partition 1 does not start on physical sector boundary.


Disk /dev/loop9: 38.83 MiB, 40714240 bytes, 79520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop8: 91.69 MiB, 96141312 bytes, 187776 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop10: 10.54 MiB, 11051008 bytes, 21584 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop11: 116.78 MiB, 122449920 bytes, 239160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop12: 500 KiB, 512000 bytes, 1000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop13: 149.63 MiB, 156901376 bytes, 306448 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
ubuntu@ubuntu:~$

On this PC I have the 8TB disk connected externally and the 2TB internal disk with the encrypted partition and the Ubuntu system partitions
thank you.

To try to minimize any over sight from me please have a look here: Ubuntu 22.04 LTS ZFS wont boot
I am the strange user name there and MAFoElffin is king on ZFS, but no longer a current member.

Read carefully as this is not a race to the finish line.
Don’t be discouraged by the OP in that thread, I think frustration set in.

I’m sorry but my is short again today…Life gets first priority. :frowning:

1fallen, I understand perfectly, the days being only 24H00, in which we have to combine sleep, work and social/family life, it is not easy for anyone.
I will read this topic, I will keep you informed of the progress, Thank you.

Best of luck my friend, and keep any questions that pop up and bring them back here in this thread.

Before I forget welcome to discourse. :wink:

Hello,

I did some new testing after reading the thread and the related ones mentioned in the first thread.
I restarted a boot with the live USB and I did a diagnostic with boot-repair by indicating the disk decryption key. Here is the result: Ubuntu Pastebin

I then tried to follow the advice given in the message of this thread: Ubuntu 22.04 LTS ZFS wont boot
Here is the result:

ubuntu@ubuntu:~$ sudo su -
root@ubuntu:~# zpool export -a
root@ubuntu:~# zpool import -f -N -R /mnt rpool
root@ubuntu:~# zpool import -f -N -R /mnt bpool
root@ubuntu:~# cryptsetup open -v /dev/zvol/rpool/keystore keystore-rpool
No usable token is available.
Enter passphrase for /dev/zvol/rpool/keystore:
Key slot 0 unlocked.
Command successful.
root@ubuntu:~# mount /dev/mapper/keystore-rpool /media
root@ubuntu:~# ls /media/system.key
/media/system.key
root@ubuntu:~# cat /media/system.key | zfs load-key -L prompt rpool
root@ubuntu:~# zfs mount $(zfs list | grep -m1 -e ‘^rpool/ROOT/ubuntu_’ | awk ‘{print $1}’ )
root@ubuntu:~# zfs mount $(zfs list | grep -m1 -e ‘^bpool/BOOT/ubuntu_’ | awk ‘{print $1}’ )
root@ubuntu:~# zfs mount -a
failed to lock /etc/exports.d/zfs.exports.lock: No such file or directory
root@ubuntu:~#

I looked in the /etc/ folder and there is no exports.d folder.
It is likely that I look in the /etc/ folder of the USB key but I do not see how to check if the exports.d folder is visible in my encrypted partition (if that is what the script is calling).

This is not looking good now, and I’m going to have to defer to anyone else that wants to chime in here.

It looks to me like you hit the same thing I did back in 22.04 and lost 4TB’s worth of data.

I have tried to recreate as best I can whats hppening on your system but I always seem to recover.
ie:

sudo zfs mount $(zfs list | grep -m1 -e ‘^rpool/ROOT/ubuntu_’ | awk ‘{print $1}’ )
awk: cmd. line:1: ‘{print
awk: cmd. line:1: ^ invalid char '�' in expression
[sudo] password for me: 
zpcachyos/ROOT/cos/root         /
zpcachyos/ROOT/cos/varlog       /var/log
zpcachyos/ROOT/cos/varcache     /var/cache
zpcachyos/ROOT/cos/home         /home

On Arch I don’t use a “bpool” in the same method Buntu dose:

zfs list
NAME                          USED  AVAIL  REFER  MOUNTPOINT
zpcachyos                    74.4G   156G   104K  none
zpcachyos/ROOT               74.4G   156G    96K  none
zpcachyos/ROOT/cos           74.4G   156G    96K  none
zpcachyos/ROOT/cos/home      49.6G   156G  45.3G  /home
zpcachyos/ROOT/cos/root      16.0G   156G  10.8G  /
zpcachyos/ROOT/cos/varcache  8.77G   156G  8.76G  /var/cache
zpcachyos/ROOT/cos/varlog     824K   156G   544K  /var/log

Dang I wish I could be a better help to you.

Not to add salt to any wounds ZFS and ZFS Encryption is labeled Experimental.

With that in mind I keep regular snapshots on the system and off the system (back-up drive) plus manual back-ups of things I just need, like Documents Pictures and Parts of /etc/.

If something lights up my memory I’ll post back here.