The error
zsh: locking failed for /root/.zsh_history: read-only file system
seems to indicate that your system is now read-only.
The default behaviour for most Linux file systems is to safeguard your data. When the kernel detects an error in the storage subsystem it will make the filesystem read-only to prevent (further) data corruption.
You can tune this somewhat with the mount option errors={continue|remount-ro|panic}
which are documented in the system manual (man mount
).
When your root file-system encounters such an error, most of the time the error won't be recorded in your log-files, as they will now be read-only too. Fortunately since it is a kernel action the original error message is recorded in memory first, in the kernel ring buffer. Unless already flushed from memory you can display the contents of the ring buffer with the dmesg
command.
Resizing the storage is a likely cause though
Depending on the error messages, you could decide it is still safe to use your file-system and attempt to return it to a read-write condition with mount -o remount,rw /