Score:3

LVM merge destroyed hard drive

hk flag

I tried to upgrade from Kubuntu 22.04 to 22.10, and borked it. Accidentally pressed Ctrl-C with the terminal window active. I think I was able to fix everything, but didn't want to chance it.

I had an LVM snapshot, so I tried to restore it from a live USB, and this seems to have destroyed the hard drive. I am completely mystified.

To create the snapshot, I did the following (this is from memory):

sudo lvcreate --snaphot --name Kubutu-snap --size 20G /dev/vg1/Kubuntu

To restore the snapshot:

sudo lvconvert --merge /dev/vg1/Kubuntu-snap

After I saw "Merge 100%" and the command terminated, I restarted the computer. Upon reboot, I got a message about my hard drive being missing.

Further info:

  • I was a bit hasty pulling the flash drive from my computer after restarting. But I don't see how this could kill the internal drive.
  • I don't know if the snapshot was overfull. I would have thought that there would be a warning if this were the case. I also can't see how this would hurt anything beside than the logical volume in question.
  • The drive is a SATA SSD.
  • I was connected to power the whole time.
  • sda used to be my SSD. sdb is the live USB.

Debugging. Upon rebooting to my live USB, it is unclear what is up with the SSD. df gives nothing.

lsblk is unhelpful.

$ sudo lsblk
...
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
(loop devices)
sda      8:0    1     0B  0 disk
sdb      8:16   0  29.2G  0 disk 
├─sdb1   8:17   0   3.4G  0 part /cdrom
├─sdb2   8:18   0   4.1M  0 part 
├─sdb3   8:19   0   300K  0 part 
└─sdb4   8:20   0  25.8G  0 part /var/crash
                                 /var/log
...
$ sudo lsblk -o UUID,NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,MODEL
...
UUID                                 NAME   FSTYPE     SIZE MOUNTPOINT               LABEL                   MODEL
(loop devices)
                                     sda                 0B                                                  SD/MMC
2022-04-19-10-22-47-00               sdb    iso9660   29.2G                          Kubuntu 22.04 LTS amd64 Extreme
2022-04-19-10-22-47-00               ├─sdb1 iso9660    3.4G /cdrom                   Kubuntu 22.04 LTS amd64 
8D6C-A9F8                            ├─sdb2 vfat       4.1M                          ESP                     
                                     ├─sdb3            300K                                                  
783b59ea-3cd8-4ef9-95e1-0d7cc906e5e6 └─sdb4 ext4      25.8G /var/crash               writable 
...

smartctl is unhelpful.

$ sudo smartctl -d scsi -a /dev/sda
...
=== START OF INFORMATION SECTION ===
Vendor:               Generic-
Product:              SD/MMC
Revision:             1.00
Compliance:           SPC-4
Logical Unit id:      0x00e04c2020202000error: designator length
Serial number:        2012090114345300
Device type:          disk
Local Time is:        Fri Dec 23 23:39:16 2022 UTC
NO MEDIUM present in device
A mandatory SMART command failed: exiting. To continue, add one or more '-T permissive' options.

Clearly, "SD/MMC" is not correct.

So, the questions:

  1. What on earth happened?
  2. Can I fix this?
Levente avatar
cn flag
I believe `smartctl` is for HDDs, not SSDs. Also try `sudo lsblk -o UUID,NAME,FSTYPE,SIZE,MOUNTPOINT,LABEL,MODEL`
Kenneth Hanson avatar
hk flag
I reran lsblk with those options. No change.
Levente avatar
cn flag
Ah, it did not mean to fix anything, it could just give you another perspective about how things look. But they don't look anyhow. I don't even know how to interpret that return value.
Kenneth Hanson avatar
hk flag
Oh, I understand. I mean no new information.
Levente avatar
cn flag
`sda` is a Secure Digital / MultiMedia Card device (`SD/MMC`). Is that supposed to be your live environment from which you booted? Anyhow, your SSD is not even visible at all...
Kenneth Hanson avatar
hk flag
Well, the SSD would have been `sda`, and there's no memory card in my computer. The only other device, `sdb`, is the live USB.
Score:0
hk flag

Problem solved! After some investigation of generic SSD problems, I tried opening the computer and reseating the SSD. The computer wouldn't turn on at all after that. I pressed the reset switch, and everything booted fine. Not sure which step did the trick.

So mystery solved: LVM merge did not in fact destroy my hard drive. I'll have to keep troubleshooting if this happens again.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.