Two weeks ago, my laptop’s SSD suddenly powered off and BTRFS went into a read only mode. It haven’t happened since then, but I’m looking to find out what has caused it.
Though my initial hunch is temperature of the laptop, as I was watching 4k video content on YT for 4 hours straight that day, but I quickly ruled it out because the entire room is under air conditioning set at 18C and my laptop is cool to touch after that, also it is constantly on a laptop cooling pad.
Here are some images I took while on the TTY.
I immediately went into a TTY and it is evident that BTRFS has went into a read-only mode.
So I checked the lsblk
command to see the drive, and this is what I saw.
Definitely my NVME SSD went offline, and this is the SSD which has my home partition. This is how it should show normally.
Looking into dmesg
I figured out what is the actual issue here. There was some issue with SSD, there were some write errors, and then there is a line saying that trim operation has failed. My SSD is Crucial P2 1TB 3D NAND NVMe PCIe M.2 SSD Up to 2400MB/s - CT1000P2SSD8.
I searched for more information on the Crucial’s page regarding TRIM, and here is what I have found.
What is SSD Trim?
TRIM is a command for the ATA interface. As you use your drive, changing and deleting information, the SSD needs to make sure that invalid information is deleted and that space is available for new information to be written. Trim tells your SSD which pieces of data can be erased.
The command is different for other interfaces, and goes by different names in different operating systems, but the action is usually referred to as “Trim”. No matter what name it goes by, Trim works with Active Garbage Collection to clean up and organize your solid state drive. Trim is beneficial, but not mandatory. Because some operating systems do not support Trim, SSD manufacturers design, create, and test their drives assuming that Trim will not be used.
Isn’t this for SATA SSDs then? My SSD is NVME and uses PCI to connect to the motherboard. So does it mean TRIM won’t be possible in my SSD case? As per my limited understanding, the equivalent operation should be DEALLOCATE and not TRIM for NVME SSDs.
After searching for a while, I have learnt about the existence of fstrim
and its timer service, so I have checked the status of it too. To my surprise, it is actually inactive. However, the timer service is indeed active.
I’m also attaching the relevant part of dmesg output here. Since I couldn’t save the output from TTY I did it after a reboot using the command journalctl -k -b -1 -o short-precise >> dmesg_output.txt
.
What should be my next step? Should I just disable this timer service and see what happens?
Btw, my kernel is 5.17.1-3-MANJARO.