1

I had Ubuntu installed on an external HDD and was enjoying it, but my computer was a little slow. I checked my processes and found out that KDE (which I had previously installed) was running its desktop in the background while I was using Unity. I didn't want KDE anymore anyway, so I ran the command sudo apt-get remove kubuntu-desktop and then sudo apt-get autoremove. Everything seemed to be working fine, but when I tried to run sudo apt-get update later, it said that it couldn't remove the lock file because the directory was read-only.

Distraught, I tried deleting the lock file manually but was again met with the read-only error. I tried remounting my drive but I was again told that the drive could only be mounted as read-only. I tried rebooting, but now I can't boot into the hard drive. I can see the (only) partition for the drive on Windows' partition manager. Is there a way to make my hard drive readable and writeable again? If not, is there a way for me to save some of my data?

Edit: Output of sudo lsblk -o name,mountpoint,label,size,fstype;sudo parted -l

Note: The hard drive I have Ubuntu installed on is a Toshiba hard drive that at the time was plugged into my USB 3.0 port.

NAME   MOUNTPOINT                               LABEL               SIZE FSTYPE
sda                                                               465.8G 
├─sda1                                          Recovery            400M ntfs
├─sda2                                          ESP                 300M vfat
├─sda3                                                              128M 
├─sda4                                          Acer              447.6G ntfs
├─sda5                                                              350M ntfs
└─sda6                                          Push Button Reset    17G ntfs
sdb                                                               465.8G 
├─sdb1 /media/ubuntu/11cf8549-8a06-429d-92f6-18                     487M ext2
├─sdb2                                                                1K 
└─sdb5                                                            465.3G LVM2_me
  ├─ubuntu--vg-root
  │                                                               464.3G ext4
  └─ubuntu--vg-swap_1
                                                                      1G swap
sdc                                                                 3.8G 
└─sdc1 /cdrom                                   UBUNTU LIVE         3.8G vfat
loop0  /rofs                                                        1.4G squashf
Model: ATA WDC WD5000LPVX-2 (scsi)
Disk /dev/sda: 500GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End    Size    File system  Name                          Flags
 1      1049kB  420MB  419MB   ntfs         Basic data partition          hidden, diag
 2      420MB   735MB  315MB   fat32        EFI system partition          boot, esp
 3      735MB   869MB  134MB                Microsoft reserved partition  msftres
 4      869MB   481GB  481GB   ntfs         Basic data partition          msftdata
 5      481GB   482GB  367MB   ntfs                                       hidden, diag
 6      482GB   500GB  18.3GB  ntfs         Basic data partition          hidden, diag


Model: TOSHIBA External USB 3.0 (scsi)
Disk /dev/sdb: 500GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End    Size   Type      File system  Flags
 1      1049kB  512MB  511MB  primary   ext2         boot
 2      513MB   500GB  500GB  extended
 5      513MB   500GB  500GB  logical                lvm


Model: SCSI SG 1.8.1.7.0 2+6 (scsi)
Disk /dev/sdc: 4035MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  4035MB  4034MB  primary  fat32        boot, lba


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu--vg-root: 499GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  Flags
 1      0.00B  499GB  499GB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/ubuntu--vg-swap_1: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags: 

Number  Start  End     Size    File system     Flags
 1      0.00B  1074MB  1074MB  linux-swap(v1)

Edit 2: I can now boot into the hard drive, but it boots into the ash terminal.

Edit 3: Image of shell https://drive.google.com/file/d/0B3JT195D9TgsVXJnekxSOGR6R1U/view?usp=drivesdk

  • Will you update your message and add the output of: sudo lsblk -o name,mountpoint,label,size,fstype;sudo parted -l? – L. D. James Feb 13 '17 at 02:05
  • I can't boot into Ubuntu. – user3499799 Feb 13 '17 at 02:13
  • Please run the command from the LiveUSB. – L. D. James Feb 13 '17 at 02:14
  • Just a few minutes, I need to make a new LiveUSB. – user3499799 Feb 13 '17 at 02:16
  • Added the output you requested. – user3499799 Feb 13 '17 at 13:38
  • Thanks. Which partition has your Ubuntu installed? – L. D. James Feb 13 '17 at 14:04
  • Partition #1 on the Toshiba drive (the one flagged boot). – user3499799 Feb 13 '17 at 14:09
  • What version of Ubuntu is installed? – L. D. James Feb 13 '17 at 14:12
  • Version 16.04. I used the same ISO for the LiveUSB and for installing onto the hard drive. – user3499799 Feb 13 '17 at 14:15
  • I'm formulating an answer to your question. I hope you don't mind these preliminary questions for a fuller understanding of your task. My recommendation, of which I'm including in the answer, is for you to reinstall 16.04, reformatting your partition to ext4. It's 8 years since ext2 has been replaced and you're missing the features of the default ext4 filesystem. Your question said you wanted to save your data, of which I'll include the backup procedure for your data in your answer if you choose this route. (continued) – L. D. James Feb 13 '17 at 14:28
  • ... Your personal data will be on the /home directory your Toshiba drive. Backup your home directory and reinstall using the ext4 format, then restore your personal data... or work with resolving the current boot problem. I can focus on either in my formatted answer. – L. D. James Feb 13 '17 at 14:31
  • I would prefer to attempt solving the current problem. I can boot into the drive now, but it boots into a shell. – user3499799 Feb 13 '17 at 14:37
  • Will you provide a screenshot of the booted shell. I'm not sure which shell you're seeing, the Bash like line editing, or a full booted shell with a login prompt. Please include the output of these commands in the screenshot ls -a and df. – L. D. James Feb 13 '17 at 14:44
  • How do you take a screenshot in the shell? – user3499799 Feb 13 '17 at 14:50
  • Sorry, I meant, photo shot. The only thing you can use is your camera. – L. D. James Feb 13 '17 at 14:52
  • Now it boots into the grub boot menu with options for Ubuntu, Ubuntu with advanced options, and two memtest options. When I selected the Ubuntu option it took me to the same shell. Pictures in a few minutes. – user3499799 Feb 13 '17 at 15:07

1 Answers1

1

Log into the system using a LiveUSB. From the live USB you can perform both the task of you question.

Task #1 - "is there a way for me to save some of my data?

" You can mount your Ubuntu partition (which by the output in your text is: /dev/sdb1) and backup your /home folder.

Task #2 - Repairing the booting problem.

From the LiveUSB Check your /etc/fstab file and verify the integrity of the entries, namely the root (/). Then boot normally after it's repaired.

Also run Boot Repair as a GUI boot repair option.

Outside of the GUI boot repair you can manually reinstall grub using the steps in this answer: https://askubuntu.com/a/877815/29012

The final issue was to eventually resolve the busybox screen which was resolved by fsck of the installed partition.

Restoring your Ubuntu desktop default

To restore your Ubuntu back to it's defaults, run these commands:

$ sudo apt install unity --reinstall
$ sudo apt install ubuntu-desktop --reinstall
$ sudo apt install lightdm --reinstall
$ sudo systemctl enable lightdm
$ sudo systemctl start lightdm
L. D. James
  • 25,036