I was trying to work on some files on my Ubuntu machine, and when I tried to save them, it told me that the disk was read only. I then rebooted the machine, but upon rebooting into Ubuntu it displayed an initramfs
command prompt with all my files gone. How do I restore my desktop environment and my files?
1 Answer
Probably a disk error(s) caused your disk to become ro.
First, lets check out the file system...
- boot to a Ubuntu Live DVD/USB
- open a
terminal
window - type
sudo fdisk -l
- identify the /dev/XXXX device name for your "Linux Filesystem"
- type
sudo fsck -f /dev/XXXX
# replacing XXXX with the number you found earlier - repeat the fsck command if there were errors
- type
reboot
Then lets check the SMART Data...
- open the
Disks
application - select
SMART Data & Tests
from the hamburger icon - review the data, looking for parameters with "sector" in the name
- take a screenshot and edit it into your question
- run the SMART Tests
-
Running the first part and using
fsck
fixed everything for me. Thank you! Feb 27, 2019 at 23:56 -
fsck
(do a file system check) of your system. The command needed may not befsck
, but may bexfs_check
so I'm speaking generally (adjust for your chosen file-system). ps: if it was a file system error, once fixed, you can reboot & login normally.