GParted missing gpart

Technical issues/questions of an intermediate or advanced nature.
User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

GParted missing gpart

Post#1 by Ed_P » 17 Nov 2022, 01:32

I've somehow lost access to my c: drive. :shock: The NTFS formatted drive's File System shows as "unknown" in GParted and clicking the Device's Attempt Data Rescue option results in Command gpart not found. Anyone have a gpart module I can borrow?

The c: drive has my Windows system on it and I do have a Windows 7 Backup of the drive but I can't restore it because the Windows restore says it can't find the drive.

Image

:sos:
Ed

donald
Full of knowledge
Full of knowledge
Posts: 2065
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

GParted missing gpart

Post#2 by donald » 17 Nov 2022, 05:29

I would use the most recent versions of GParted Live -- Download:
https://gparted.org/download.php

----------------------------------------------------------------------------------------------------

If the ntfs-3g package/driver is present in your system (locate ntfs-3g).
a tool called ntfsfix should be included.(try ntfsfix --help).

Note:
I haven't seen/used Windows since the year 2000.
I do not recomment to use any of these low-level tools unless you are absolutely
sure what they do and you have at least a full disk backup.

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

GParted missing gpart

Post#3 by Ed_P » 17 Nov 2022, 06:12

donald wrote:
17 Nov 2022, 05:29
(locate ntfs-3g)
(try ntfsfix --help)
Thank you donald. :friends:

Code: Select all

guest@porteus:~$ locate ntfs-3g
locate: unexpected EOF reading `/var/lib/mlocate/mlocate.db'

guest@porteus:~$ ntfsfix --help
ntfsfix v2021.8.22 (libntfs-3g)

Usage: ntfsfix [options] device
    Attempt to fix an NTFS partition.

    -b, --clear-bad-sectors Clear the bad sector list
    -d, --clear-dirty       Clear the volume dirty flag
    -h, --help              Display this help
    -n, --no-action         Do not write anything
    -V, --version           Display version information

For example: ntfsfix /dev/hda6

Developers' email address: ntfs-3g-devel@lists.sf.net
News, support and information:  http://tuxera.com
guest@porteus:~$ 
It looks promising. :)

Added in 11 minutes 33 seconds:
:thumbsup:

Code: Select all

guest@porteus:~$ su
Password: 
root@porteus:/home/guest# ntfsfix -n /dev/nvme0n1p3
Mounting volume... NTFS signature is missing.
FAILED
Attempting to correct errors... NTFS signature is missing.
FAILED
Failed to startup volume: Invalid argument
NTFS signature is missing.
Trying the alternate boot sector
The alternate bootsector is usable
Set sector count to 381149183 instead of 381149176
The startup data can be fixed, but no change was requested
Volume is corrupt. You should run chkdsk.
No change made

root@porteus:/home/guest# chkdsk
bash: chkdsk: command not found

root@porteus:/home/guest# ntfsfix  /dev/nvme0n1p3
Mounting volume... NTFS signature is missing.
FAILED
Attempting to correct errors... NTFS signature is missing.
FAILED
Failed to startup volume: Invalid argument
NTFS signature is missing.
Trying the alternate boot sector
The alternate bootsector is usable
Set sector count to 381149183 instead of 381149176
Rewriting the bootsector
The boot sector has been rewritten

Processing $MFT and $MFTMirr...
Reading $MFT... OK
Reading $MFTMirr... OK
Comparing $MFTMirr to $MFT... OK
Processing of $MFT and $MFTMirr completed successfully.
Corrupted file $UpCase
Rewriting $UpCase file
$UpCase has been set to default
Setting required flags on partition... OK
Going to empty the journal ($LogFile)... OK
Checking the alternate boot sector... FIXED
NTFS volume version is 3.1.
NTFS partition /dev/nvme0n1p3 was processed successfully.
root@porteus:/home/guest# 
Thank you :worthy: donald.
Ed

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3925
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

GParted missing gpart

Post#4 by ncmprhnsbl » 17 Nov 2022, 06:31

for anyone looking for gpart:
gpart: https://slakfinder.org/sbomt64-15.0/system/gpart/
A tool which tries to guess the primary partition table of a PC-type hard disk in case the primary partition table in sector 0 is damaged, incorrect or deleted. The guessed table can be written to a file or device.
i guess this is just a part of the 'attempt data rescue' process..
seems like you have it handled..
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

GParted missing gpart

Post#5 by Rava » 17 Nov 2022, 08:41

donald wrote:
17 Nov 2022, 05:29
I haven't seen/used Windows since the year 2000.
That's one of the best year 2000 wishes I ever heard of. :D
Ed_P wrote:
17 Nov 2022, 06:24
Thank you :worthy: donald.
Good it worked for you.

And I do recommend for anyone having some NTFS partition (sometimes it is not even because of windows but because the external hard disk was formatted that way and you kept it cause you want to use large files on it (e.g. DVD ISOs) and cannot use ext[234] because you use it in connection with a digital sat receiver for TV recordings or such.
and that leaves you with only NTFS unless you skip on the ability to store large files then you can also use VFAT.

Then either have also the newest gpart at hand
ncmprhnsbl wrote:
17 Nov 2022, 06:31
for anyone looking for gpart:
gpart: https://slakfinder.org/sbomt64-15.0/system/gpart/
or use the newest GParted Live
donald wrote:
17 Nov 2022, 05:29
I would use the most recent versions of GParted Live -- Download:
https://gparted.org/download.php
Added in 54 seconds:
I personally side with donald here and would go with the most recent GParted Live.
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

GParted missing gpart

Post#6 by Ed_P » 17 Nov 2022, 16:47

ncmprhnsbl wrote:
17 Nov 2022, 06:31
for anyone looking for gpart:
gpart: https://slakfinder.org/sbomt64-15.0/system/gpart/
Thank you ncmp. :beer: It's too bad all the files couldn't have been in a single zip. I downloaded all of them but yet to use them.
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

GParted missing gpart

Post#7 by Rava » 17 Nov 2022, 16:50

Ed_P wrote:
17 Nov 2022, 16:47
Thank you ncmp. :beer: It's too bad all the files couldn't have been in a single zip. I downloaded all of them but yet to use them.
You only need the txz, or not?
So wget'ing https://slakfinder.org/sbomt64-15.0/sys ... 4-2smt.txz should suffice.

Added in 3 minutes 27 seconds:

Code: Select all

guest@porteus:/tmp/gpart$ wget https://slakfinder.org/sbomt64-15.0/system/gpart/gpart-0.3-x86_64-2smt.txz
--2022-11-17 17:51:17--  https://slakfinder.org/sbomt64-15.0/system/gpart/gpart-0.3-x86_64-2smt.txz
Resolving slakfinder.org (slakfinder.org)... 161.97.104.182
Connecting to slakfinder.org (slakfinder.org)|161.97.104.182|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 36460 (36K)
Saving to: ‘gpart-0.3-x86_64-2smt.txz’

gpart-0.3-x86_64-2s 100%[===================>]  35.61K  --.-KB/s    in 0.1s    

2022-11-17 17:51:18 (374 KB/s) - ‘gpart-0.3-x86_64-2smt.txz’ saved [36460/36460]

guest@porteus:/tmp/gpart$ txz2xzm gpart-0.3-x86_64-2smt.txz 
Verifying package gpart-0.3-x86_64-2smt.txz.
Installing package gpart-0.3-x86_64-2smt.txz:
PACKAGE DESCRIPTION:smt
# gpart (Guess PC-type hard disk partitions)
#
# A tool which tries to guess the primary partition table of a PC-type
# hard disk in case the primary partition table in sector 0 is damaged,
# incorrect or deleted. The guessed table can be written to a file or
# device.
#
# Homepage: https://github.com/baruch/gpart
#
Package gpart-0.3-x86_64-2smt.txz installed.
Creating /tmp/gpart/gpart-0.3-x86_64-2smt.xzm

guest@porteus:/tmp/gpart$ ls -o gpart-0.3-x86_64-2smt.*|cut -c 20-
36460 2022-05-10 09:14 gpart-0.3-x86_64-2smt.txz
36864 2022-11-17 17:51 gpart-0.3-x86_64-2smt.xzm
Downloading it and creating the module took less than a minute.
Including giving the non "toor" password (I change root's pw for a more secure one via script) for switching to root.

Heck, even writing this addon to my post did take longer than downloading and creating the module. :Yahoo!:

Added in 4 minutes 7 seconds:
My lsfind database told me I already have an gpart-0.3 module from 2021:

Code: Select all

root@porteus:/Lsfind# zgrep gpart-0.3 intHDD1*gz
intHDD1_5.find.gz:./Porteus_modules/5.0/gpart-0.3-x86_64-3_slonly.xzm
intHDD1_5.ls.gz:-rw-r--r--  1 root      36864 2021-01-28 06:40 gpart-0.3-x86_64-3_slonly.xzm
I wonder if the program binaries inside the modules differ.

Most probably since one is by slonly and the other by smt.
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8343
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

GParted missing gpart

Post#8 by Ed_P » 17 Nov 2022, 17:01

Rava wrote:
17 Nov 2022, 08:41
or use the newest GParted Live
The newest version, gparted-live-1.4.0-6-amd64.iso, appears to be for AMD systems, mine is Intel based. But I've downloaded the iso and will try it later.

While I got Windows to boot last night I didn't get to do the restore of the backup. I think some of my problem was caused by using a old version of Windows Recovery which may not have supported my SSD's nvmeon1p3 drive. Fortunately ntfsfix restored the directory entry from the backup directory and rebooting got me into Dell and Windows Recovery functions and I was able to boot Windows before going to bed. Today I made a new Windows 11 Recovery USB drive so we'll see how that goes.
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5401
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

GParted missing gpart

Post#9 by Rava » 17 Nov 2022, 17:09

Ed_P wrote:
17 Nov 2022, 17:01
The newest version, gparted-live-1.4.0-6-amd64.iso, appears to be for AMD systems, mine is Intel based. But I've downloaded the iso and will try it later.
sometimes maintainers refer to x86-64 ISOs or packages as "amd64" instead of "x86-64" or just "64 bit", usually these all also work on Intel x86-64 systems.

Back to the two gpart modules. mounted them both into /tmp, the binaries inside do differ but they still both report the same version:

Code: Select all

root@porteus:~# cd /tmp/gpart/
root@porteus:/tmp/gpart# cp /Porteus_modules/gpart-0.3-x86_64-3_slonly.xzm .
root@porteus:/tmp/gpart# mkdir gpart-0.3-x86_64-2smt
root@porteus:/tmp/gpart# mkdir gpart-0.3-x86_64-3_slonly
root@porteus:/tmp/gpart# mount gpart-0.3-x86_64-2smt.xzm gpart-0.3-x86_64-2smt
root@porteus:/tmp/gpart# mount gpart-0.3-x86_64-3_slonly.xzm gpart-0.3-x86_64-3_slonly
root@porteus:/tmp/gpart# ls -o */usr/sbin/gpart
-rwxr-xr-x 1 root 44456 2022-05-10 09:14 gpart-0.3-x86_64-2smt/usr/sbin/gpart
-rwxr-xr-x 1 root 44288 2017-05-08 00:01 gpart-0.3-x86_64-3_slonly/usr/sbin/gpart
root@porteus:/tmp/gpart# gpart-0.3-x86_64-2smt/usr/sbin/gpart -V
gpart v0.2.3-dev
root@porteus:/tmp/gpart# gpart-0.3-x86_64-3_slonly/usr/sbin/gpart -V
gpart v0.2.3-dev
Image
Cheers!
Yours Rava

Post Reply