LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-29-2016, 01:27 PM   #1
mailtomsa
LQ Newbie
 
Registered: Nov 2015
Posts: 21

Rep: Reputation: Disabled
Question Comparing current GPT partition table against a backup


Hello,

I have a GPT partition table backup/dump that I created using "sgdisk -b".

My "live" partition table seems to have changed (the Windows system of my dual boot is no longer booting) and I would like to somehow look at what is different between the backup and the "live" partition tables.

Can I do that? Or is there something to display the content of the binary backup file in a more human-readable format, something similar to what gdisk's "p" ("print the partition table") command does?

Thank you!
 
Old 02-01-2016, 05:46 PM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
You could print the detail of the current gpt configuration using the "-i" switch, back the current partition data up using the "-b" switch and then load the previous backed up partition data using the "-l" switch. If you then run "-i" again to get the original detail you'd be able to compare the two. You could then restore the last backup of the partition data.
Of course, I'd be sure to do a full back up (or perhaps a disk image) and be ready to reinstall both OS's before I started that process in case something went awry.

Last edited by dijetlo; 02-01-2016 at 05:47 PM.
 
Old 02-01-2016, 06:14 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by mailtomsa View Post
My "live" partition table seems to have changed (the Windows system of my dual boot is no longer booting)
Do you have any reason to make this association ?. Pretty tenuous I would reckon.

I'm surprised Rod hasn't a tool to do this - maybe try loop mounting the file and simply run gdisk against that
 
Old 02-01-2016, 06:52 PM   #4
mailtomsa
LQ Newbie
 
Registered: Nov 2015
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by syg00 View Post
Do you have any reason to make this association ?. Pretty tenuous I would reckon.
Well, it's mostly that I want to verify if and what changed in the partition tables (probably just a partition type marker) before I restore the backup in order to make sure that restoring the backup makes sense and fixes my problem before I risk messing up even more if something goes wrong with restoring the backup.

I was thinking about a loop device as well (trying to set up a small size loop device and restoring the backup into that), but have not tried it yet...
 
Old 02-03-2016, 02:29 AM   #5
mailtomsa
LQ Newbie
 
Registered: Nov 2015
Posts: 21

Original Poster
Rep: Reputation: Disabled
Oooops... I just tried
Code:
gdisk -l <my_backup_file>
and it displayed the partitions from the backup file just the way
Code:
gdisk -l /dev/sda
would.


Who would have thought it's that easy...
 
1 members found this post helpful.
Old 02-03-2016, 02:46 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Who'd thunked. +1 for Rod.

I tested the loop mount, that worked too.
 
  


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
Does a GUID Partition Table (GPT) need a different layout than MBR? General Linux - General 8 03-20-2015 08:35 PM
[SOLVED] Installing Slackware with GPT partition table Skaperen Slackware 22 12-28-2014 06:33 AM
[SOLVED] Damn cgdisk & gpt partition table v3ct0r Linux - Newbie 6 09-10-2013 07:13 AM
Migration from MSDOS partition table to GPT davepi Linux - General 4 09-30-2012 11:30 PM
Which distro(s) work with GPT partition table? ozegoods Linux - General 5 12-13-2010 06:57 PM

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

All times are GMT -5. The time now is 02:20 AM.

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