LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-22-2021, 04:16 PM   #1
hiddenocelot
LQ Newbie
 
Registered: Nov 2021
Posts: 2

Rep: Reputation: Disabled
Corrupted USB drive partition table


Hi all,

I've had a USB that I'm trying to format but it seems to be giving me some trouble. Originally I had an ISO for a now unnecessary Linux distribution. I deleted this and formatted the drive but all is not well. It allows me to format ~20Gb out of 30Gb available into ext4, but no more. It seems ok in exFAT format for now but I'm not 100% sure if it works fine.

I am unable to shred the contents of the drive for some reason and it appears to have a corrupted partition table. I've used gdisk a little but this has not fixed anything. I don't need any of the data on the drive, although I intend to backup my system on it, so it's important that I can trust it.

The output from gdisk below highlights that the partition table is corrupted.

Code:
sudo gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.8

Caution: invalid backup GPT header, but valid main header; regenerating
backup header from main header.

Warning! Main and backup partition tables differ! Use the 'c' and 'e' options
on the recovery & transformation menu to examine the two tables.

Warning! One or more CRCs don't match. You should repair the disk!
Main header: OK
Backup header: ERROR
Main partition table: OK
Backup partition table: ERROR

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: damaged

****************************************************************************
Caution: Found protective or hybrid MBR and corrupt GPT. Using GPT, but disk
verification and recovery are STRONGLY recommended.
****************************************************************************

Command (? for help): v 

Caution: The CRC for the backup partition table is invalid. This table may
be corrupt. This program will automatically create a new backup partition
table when you save your partitions.

Identified 1 problems!
Does anyone know how to help? I was also unsure where to post this so I put it in general. I'm happy to get directed to somewhere more relevant
 
Old 11-22-2021, 05:18 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Assuming a USB key/pen, why gpt ?.
It's almost mandatory on (big) disk these days, but not keys - it's needlessly complex for the job. I don't know why ext4 is limited like that, but it's not worth the effort to chase IMHO - try MBR.
 
Old 11-22-2021, 06:35 PM   #3
hiddenocelot
LQ Newbie
 
Registered: Nov 2021
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hmmm to be honest I don't know the difference, but I had the impression it was the more modern format. I'll try that out when I have the time
 
Old 11-22-2021, 06:50 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,020

Rep: Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630Reputation: 3630
If you need data I think fdisk has a recovery mode option. Otherwise one can just clear it. Maybe some programs like gparted might call it initialize or something.
 
Old 11-23-2021, 02:35 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
AFAIU you do not need the data in the USB stick anymore?
And want to shred it before partitioning it anew?

I'd use dd for the shredding.
It's very simple, but you have to be 125% sure you have the right drive:
Code:
dd if=/dev/urandom of=/dev/sdX bs=4M
You need elevated privileges.
Replace X with your drive letter.
bs=4M is not necessary but will likely speed things up. Even so, it can take a while for 30GB.

Then, I'd use gparted to create a new partition table (MSDOS) and the partitions I want (all of them physical unless you plan to have more than 4).
And any ext4 partition can be larger than 20GB.
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] MySQL run SELECT on a table if column A form table 1 equals column A from table 2 robertjinx Linux - Software 1 01-15-2016 10:48 AM
corrupted ntfs partition table on usb drive valerian Linux - Software 11 04-24-2014 11:03 AM
Ubuntu 9.x install corrupted NTFS partition; repair corrupted TrueCrypt partition halfer Linux - General 1 06-30-2009 02:59 PM
"No partition table or unknown signature on partition table" 10.1 install madcow007 Slackware 4 02-09-2009 11:04 AM
Slack 10: S-ATA = "No partition table or unknown signature on partition table"? dissolved soul Slackware - Installation 11 08-05-2004 02:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration