0

Answer: The drive was formatted as LVM2 (no encryption) and that requires some extra steps. A tutorial for lvm is available here cyberciti.biz/faq/linux-mount-an-lvm-volume-partition-command. See answer below and comments.

My old computer has some, uhm "health issues" and I need to access information on its hard drive. It had Ubuntu 20.04 installed. I have extracted the hard drive and connected it as an external drive to another Ubuntu 20.04 computer (using a hard drive enclosure that allows me to just plug it in through the usb).

I can now see my old hard drive as:

dslavchev@computer_name:/media/dslavchev/DF73-1BD6$ tree
.
├── $RECYCLE.BIN
│   └── desktop.ini
├── EFI
│   ├── BOOT
│   │   ├── BOOTX64.EFI
│   │   ├── fbx64.efi
│   │   └── mmx64.efi
│   └── ubuntu
│       ├── BOOTX64.CSV
│       ├── grub.cfg
│       ├── grubx64.efi
│       ├── mmx64.efi
│       └── shimx64.efi
└── System Volume Information
    ├── IndexerVolumeGuid
    └── WPSettings.dat

5 directories, 11 files

I assume that one of the .efi files has all of the files (except system and boot files). And I probably need to mount it, but I am not sure how to identify which one and how exactly to mount it.

EDIT: I forgot to add that the old hard disk showed some bad partitions just before my old computer broke. The old computer has some motherboard RAM burned, according to the repair shop. Disks shows that there is one bad sector on the disk.

Disks doesn't give me play options as proposed by Vassilis Theodoropoulos bellow. Screenshot of Disks

fdisk returns the following output:

[sudo] password for dslavchev: 
Disk /dev/loop0: 218,102 MiB, 229629952 bytes, 448496 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop1: 55,48 MiB, 58159104 bytes, 113592 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop2: 31,9 MiB, 32595968 bytes, 63664 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop3: 51,4 MiB, 53522432 bytes, 104536 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop4: 64,79 MiB, 67915776 bytes, 132648 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop5: 32,28 MiB, 33841152 bytes, 66096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop6: 55,46 MiB, 58142720 bytes, 113560 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/loop7: 65,1 MiB, 68259840 bytes, 133320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 931,53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: TOSHIBA MQ04ABF1
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 9374EFB0-7975-4D34-8DA6-6CA7275FF5E8

Device       Start        End    Sectors  Size Type
/dev/sda1     2048    1050623    1048576  512M EFI System
/dev/sda2  1050624 1953523711 1952473088  931G Linux filesystem


Disk /dev/sdb: 931,53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: 048-2E7172      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x7de20091

Device     Boot   Start        End    Sectors  Size Id Type
/dev/sdb1  *       2048    1050623    1048576  512M  b W95 FAT32
/dev/sdb2       1050624 1953523711 1952473088  931G 8e Linux LVM
5
  • Are you sure that there is no other partition? Usually the EFI files are in a separate partition, and you would want to look at the root (/) partition of Ubuntu. Apr 29, 2021 at 13:43
  • You don’t want the EFI partition. That just has boot files. Your data will be on the second partition. If you add the output of lsblk we will be able to see which disk is yours and which is the other computers disk.
    – PonJar
    Apr 29, 2021 at 13:51
  • You should be able to mount your drive via the disks application
    – PonJar
    Apr 29, 2021 at 13:52
  • @user68186 To my knowledge I didn't use encryption. Is there a way to check? Apr 29, 2021 at 15:54
  • It is possible that the hard drive had failed before and the partition is ineligible. Apr 29, 2021 at 16:08

1 Answer 1

1

If you try the application named "disks" you will see that there is at least one more partition. This is the partition you are looking for and not the EFI partition which has only the boot files. You can mount the right partition by clicking the "play" button in the disks application.

EDIT:

Since it is an LVM2 partition you should follow the steps below:

Install LVM2

$ sudo apt install lvm2

Scan for the LVM2 partition

run

$ sudo vgscan

or

$ sudo vgscan --mknodes

the output indicates the LVM group.

To activate it run

$ sudo vgchange -ay

or

$ sudo vgchange -ay "LVM_Group_Name"

where "LVM_Group_Name" stands for the LVM group indicated in the previous step (write it without the quotation marks)

In order to list it run the following command

$ sudo lvdisplay 

or

$ sudo lvs

Mount the LVM2 partition

Create a mount point

$ sudo mkdir -vp /mnt/My_Lovely_Partition_Name/{root,home}

(instead of My_Lovely_Partition_Name you can use whatever name you want)

Mount both home and root volumes from LV path

$ sudo mount {LV_PATH} /path/to/mount/point/
$ sudo mount /dev/LVM_Group_Name/home /mnt/My_Lovely_Partition_Name/home
$ sudo mount /dev/LVM_Group_Name/root /mnt/My_Lovely_Partition_Name/root

Verify it

$ df -T
$ df -T | grep -i fedora
$ ls /mnt/My_Lovely_Partition_Name/root
$ ls /mnt/My_Lovely_Partition_Name/home

Update /etc/fstab file if you want it to be mounted automatically on boot

/dev/mapper/LVM_Group_Name-root /mnt/My_Lovely_Partition_Name/root ext4 defaults 0 0
/dev/mapper/LVM_Group_Name-home /mnt/My_Lovely_Partition_Name/home ext4 defaults 0 0

All credits goes to Vivek Gite

5
  • The Disks doesn't show me play as an option. I added a screenshot in the question. Apr 29, 2021 at 16:07
  • It's an LVM2 partition that's why. I believe this tutorial will help you cyberciti.biz/faq/linux-mount-an-lvm-volume-partition-command Apr 29, 2021 at 16:23
  • Great, that worked. Thank you. Please add the comment to the answer. Apr 29, 2021 at 18:02
  • 1
    I'm glad you were able to mount the partition! I updated the answer. Apr 30, 2021 at 20:28
  • Yeah, me too. Unfortunately after I tried to copy some files only the folders were copied and I had an error. I have some warnings that the there are bad blocks. I guess the hard disk is fried up. So I will have to search for that, but it is a different topic. May 4, 2021 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.