Can't log on but gPart sees system (Resolved but not solved)

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
digger44
Level 3
Level 3
Posts: 102
Joined: Thu Jul 28, 2016 3:24 am

Can't log on but gPart sees system (Resolved but not solved)

Post by digger44 »

I have an old Lenovo Z580 with Linux Mint 20.2. The disk is encrypted. It is a WDC 1TB . I had just finished running a Timeshift to an external encrypted 4TB hard disk and was just starting to delete an old Timeshift when the screen just went black. I rebooted and what came up was the list of boot options found in the bios. I tried the Ubuntu option but only got the list again.
I started it up again with an 19.1 Mint install disk. I went to gParted and got these 3 results:
1. Unallocated 1.22gb
2, /dev/sda1 (encrypted) 2.0mb used 2.0mb msftdata flag luks
3. unallocated 930.3gb

It said that this had a GUID Partition table disk is ok, 1 bad sector

Then i went to DISKS and got
1. 1.3gb /dev/sda
2. 2.1mb luks /dev/sda1 basic data partition
3. 999gb /dev/sda unallocated space
I(f anyone can help me with this I would be greatly appreciative especially if the HD is salvageable. Thanks

I ran this from https://askubuntu.com/questions/719409/ ... nd-there-i
sudo -i
apt-get update
apt-get install cryptsetup lvm2
fdisk -l
cryptsetup luksOpen /dev/sda? TAG # sda? is your root partition
vgchange -ay
vgscan
vgchange -ay [VOLUME GROUP NAME] # From the above command
lvscan
mount /dev/[VOLUME GROUP NAME]/[LOGICAL VOLUME NAME] /mnt # LOGICAL VOLUME NAME from above command
modprobe efivars
mount /dev/sda? /mnt/boot/efi # sda? is your efi partition
mount --bind /dev /mnt/dev
mount --bind /dev/pts /mnt/dev/pts
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
cp /etc/resolv.conf /mnt/etc/

But when I got to cryptsetup luksOpen /dev/sda1 TAG
Enter passphrase for /dev/sda1: it returned the error "Requested offset is beyond real size of device /dev/sda1."


Top
Last edited by LockBot on Sat Aug 05, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
acerimusdux
Level 5
Level 5
Posts: 633
Joined: Sat Dec 26, 2009 3:36 pm

Re: Can't log on but gPart sees system

Post by acerimusdux »

Well /dev/sda1 isn't your root partition (it's too small for that), that's why you get an error. It looks like you may have a corrupted partition table, as the root partition isn't showing there. On the live install disk, try installing the program testdisk:

Code: Select all

sudo apt install testdisk
Then run it as root:

Code: Select all

sudo testdisk
You should be able to select the appropriate disk, it should find the partition table, and you should be able to choose "analyze", and search for missing partitions. It will then allow you to write a new partition table. See here for a more complete tutorial.

Edit: Ah, but this will be different with the full disk encryption. Do you have a backup of the Luks header? Look into that first.
digger44
Level 3
Level 3
Posts: 102
Joined: Thu Jul 28, 2016 3:24 am

Re: Can't log on but gPart sees system

Post by digger44 »

Thank you so much acerimusdux for replying to my problem. Although I've beem a Linux user for years I am still a novice at understanding the technical aspects of the OS. As you instructed I downloaded and ran Testdisk. (Btw I do not have a backup of the Kuks header or at least I don't think I do, but I really don't know where to look.) I ran testdisk. It took me 11 hours to get through it and I chose the highlighted first item 2048 (MS Data 2048 1050623 1048576 [NO NAME]
Directory /

>drwxr-xr-x 0 0 0 11-Feb-2020 11:44 EFI
I don't know if this is correct or how to proceed from here (and I did read TestDisk Step By Step, but I'm really not clever enough to really understand it).
I've included a copy of the log file up to this point and would appreciate any help you could provide. I know a little about computers but I'm 78 and have not been right on top of things for awhile. Thanks, I am not going to turn my computer off and hope that it stays on (I'm in the Philippines and sometimes the power takes sudden dips and I have no working battery with this old machine.
I tried to attach the testdisk.log but it said that it was far too large (its only 61kb so I don't understand why, So I created a tar,gz file which seems to have taken.
Attachments
testdisk.log.tar.gz
(4.54 KiB) Downloaded 9 times
mikeflan
Level 17
Level 17
Posts: 7106
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Can't log on but gPart sees system

Post by mikeflan »

Please answer this question from acerimusdux:
Edit: Ah, but this will be different with the full disk encryption. Do you have a backup of the Luks header? Look into that first.
I don't see anything wrong with the TestDisk. That is not to say there is no problem, just that I don't see one.
acerimusdux
Level 5
Level 5
Posts: 633
Joined: Sat Dec 26, 2009 3:36 pm

Re: Can't log on but gPart sees system

Post by acerimusdux »

Boot again from the install disk and run:

Code: Select all

sudo lvdisplay
sudo vgdisplay
sudo pvdisplay
digger44
Level 3
Level 3
Posts: 102
Joined: Thu Jul 28, 2016 3:24 am

Re: Can't log on but gPart sees system

Post by digger44 »

Thank both MikeFlan and acerimusdux for your concern. In answer to mikeFlan I don't believe that I have a backup to the luks header and really don't know where to look. To answer acerimusdux here is the result of the commands you wanted me to try:
mint@mint:~$ sudo lvdisplay
mint@mint:~$ sudo vgdisplay
mint@mint:~$ pvdisplay
WARNING: Running as a non-root user. Functionality may be unavailable.
/run/lvm/lvmetad.socket: access failed: Permission denied
WARNING: Failed to connect to lvmetad. Falling back to device scanning.
/run/lock/lvm/P_global:aux: open failed: Permission denied
Unable to obtain global lock.
mint@mint:~$

Again I appreciate your quick response. I really am out of my depth here. Thank you.
digger44
Level 3
Level 3
Posts: 102
Joined: Thu Jul 28, 2016 3:24 am

Re: Can't log on but gPart sees system

Post by digger44 »

Anyone have any further suggestions? I'd appreciate any further help. Thank you.
mikeflan
Level 17
Level 17
Posts: 7106
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Can't log on but gPart sees system

Post by mikeflan »

I started it up again with an 19.1 Mint install disk. I went to gParted and got these 3 results:
1. Unallocated 1.22gb
2, /dev/sda1 (encrypted) 2.0mb used 2.0mb msftdata flag luks
3. unallocated 930.3gb

It said that this had a GUID Partition table disk is ok, 1 bad sector

Then i went to DISKS and got
1. 1.3gb /dev/sda
2. 2.1mb luks /dev/sda1 basic data partition
3. 999gb /dev/sda unallocated space
sda is 99+% unallocated space. I suspect you may not get much data off it.
Do you have backups of your data?
Can we wipe the disk and start over?

Is sda your only disk? To find out post the results of this in a terminal:

Code: Select all

df -Th; echo; blkid; echo; sudo parted -l
digger44
Level 3
Level 3
Posts: 102
Joined: Thu Jul 28, 2016 3:24 am

Re: Can't log on but gPart sees system

Post by digger44 »

Again, thank you Mikeflan for your response. I ran the command you gave and the results are in a file I attached. I have run timeshift onto another luks encoded external drive (which won't let me access it with the live cd). I've also copied some files onto the same external hard drive, but there are still items that I need on the original hard drive and would like to get them, if possible. I appreciate the efforts that you and others have given me. If there is any way of saving the hard drive then that would be preferable of course. For the life of me I can't understand why deleting one of the old timeshift files would end up in blocking me from access to the disk. Thank you again for your expertise. I am really ignorant of so much of linux's OS even though I have been using it for years.
Attachments
new doc.txt
(1.62 KiB) Downloaded 9 times
mikeflan
Level 17
Level 17
Posts: 7106
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Can't log on but gPart sees system

Post by mikeflan »

For the life of me I can't understand why deleting one of the old timeshift files would end up in blocking me from access to the disk.
Me either. I suspect it was a disk failure, but I don't see that in TestDisk.
I ran testdisk. It took me 11 hours to get through it
I'd say you gave it a good go.

Really, no backup to "Seagate Backup Plus Drive". That is a shame.

your sda is now just 2 GB (mostly unallocated space). I keep good backups, so I have not done this in 25+ years, but you should seek "recovery" options:

Recover files from a faulty drive:
PhotoRec
TestDisk
https://www.cgsecurity.org/wiki/TestDisk
https://www.cgsecurity.org/wiki/PhotoRec
http://www.youtube.com/watch?v=6VSKbo3D5AQ
http://www.supergrubdisk.org/rescatux/
https://sourceforge.net/projects/crunch ... b/download

If none of those work, maybe you should try other options in windows??
digger44
Level 3
Level 3
Posts: 102
Joined: Thu Jul 28, 2016 3:24 am

Re: Can't log on but gPart sees system

Post by digger44 »

Thank you Mikeflan. I used photorec with sda to produce the items I have attached but I have no clue as to what to do with them. Unfortunately the attach file here would not let me attach the file even when compressed because it was too big, Next I used rescatux but had no success there. Finally I used boot-repair and got the attached (I foolishly changed the size of the luks partition which I suppose may have screwed things up even further) Having run out of ideas I think I've arrived at the conclusion that I just need to install Mint 21.1 and start from there. What do you think? Thanks for the time you and others have given me.
Attachments
Boot-Info_20230216_0854.txt
(10.04 KiB) Downloaded 5 times
boot-repair.log
(12.89 KiB) Downloaded 6 times
mikeflan
Level 17
Level 17
Posts: 7106
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Can't log on but gPart sees system

Post by mikeflan »

I just need to install Mint 21.1 and start from there.
That is what I would do. You can take an image of that 1 TB drive in case you want to work on it more later. I don't know if that image would be a large directory or a small directory, but I suspect a very small directory.

More importantly, devise simple methods to backup. If that "Seagate Backup Plus Drive" is always connected (or even if it is not), you can probably create Freefilesync batch files that you double click and the backup is over in 4 seconds. Sometimes I am doing that every 10 - 20 minutes while I am working. It's hard to get simpler than that with a manual backup solution.
digger44
Level 3
Level 3
Posts: 102
Joined: Thu Jul 28, 2016 3:24 am

Re: Can't log on but gPart sees system

Post by digger44 »

Thank you Mikeflan. I guess that that is what I will do. Is thefre a place that I can go to learn how to set up that batch file?
mikeflan
Level 17
Level 17
Posts: 7106
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Can't log on but gPart sees system (Resolved but not solved)

Post by mikeflan »

It's not as complicated as it sounds in this video:
https://www.youtube.com/watch?v=fkB47wwwIIA

I say you should not run it minimized.

Another:
https://freefilesync.org/manual.php?top ... batch-jobs
Locked

Return to “Software & Applications”