1

I made a bad mistake .I mounted a /dev/sda2 as /tmp folder in Ubuntu 20.04 LTS.

I think this filesystem /dev/sda2 is a part of logical partition.

lsblk result before mount:

lsblk result before mount

then Ubuntu won't boot again.

Is /dev/sda2 content has been deleted? if not how can i undo mount command

1 Answers1

1

The directory /tmp is periodically deleted. Therefore, there is a chance that the contents of your /dev/sda2 has been deleted.

You can inspect the contents of your /dev/sda2 partition by mounting it, obviously not again under a critical system folder. The easiest way will be to click the icon of the drive in your file manager. From the terminal, you could temporarily mount under /mnt with the command

sudo mount /dev/sda2 /mnt

after which the command

ls /mnt

will show the contents. Again, if you persistently mounted the partition on /tmp and rebooted, the contents of /dev/sda2 may be gone. If this are personal data, it is hoped that you have a backup. Otherwise, your only hope is file recovery, but that is a difficult process where full recovery is not always possible.

vanadium
  • 97,564