LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-12-2014, 11:37 AM   #1
dorlack
Member
 
Registered: Oct 2009
Location: Cambridge MA
Distribution: Any Linux
Posts: 122

Rep: Reputation: 2
Damage Control on a mistype command


Hello,
I need some help on determining damage control on a server the engineers were trying to extend a file system on.

Below is the the command that was run:

/sbin/parted /dev/sdg mklabel gpt yes && /sbin/parted /dev/sdg mkpart primary xfs -a optimal 1 100%

The mistake is /dev/sdg




We totally screwed here?

also seeing this when fdisk

WARNING: GPT (GUID Partition Table) detected on '/dev/sdh'! The util fdisk doesn't support GPT. Use GNU Parted.

Last edited by dorlack; 12-12-2014 at 11:47 AM.
 
Old 12-12-2014, 11:51 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,344

Rep: Reputation: Disabled
The engineer obviously nuked the partition table, but if that's all s/he did, no data has actually been deleted or overwritten.

For quite some time, partitioning tools have defaulted to starting the first partition at sector 2048, which represents a 1 Mb offset from the start of the drive. Unless this drive was originally partitioned using an ancient tool, the creation of a GUID partition table would not have overwritten any partitions.

If you can reconstruct the original partition layout, the file systems and associated data should reappear.

Edit: I spoke too soon. I see now that the engineer also created a partition with an XFS file system. That would indeed overwrite the existing file system on the previous partition. Time to restore from backups.

Last edited by Ser Olmy; 12-12-2014 at 11:55 AM.
 
Old 12-12-2014, 12:04 PM   #3
dorlack
Member
 
Registered: Oct 2009
Location: Cambridge MA
Distribution: Any Linux
Posts: 122

Original Poster
Rep: Reputation: 2
Is it waiting for the reboot to kill the data? everything still seems in place
 
Old 12-12-2014, 12:05 PM   #4
dorlack
Member
 
Registered: Oct 2009
Location: Cambridge MA
Distribution: Any Linux
Posts: 122

Original Poster
Rep: Reputation: 2
also it was xfs before

Looks like this error has been around for sometime regarding GPT not being supported.
 
Old 12-12-2014, 01:22 PM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,344

Rep: Reputation: Disabled
No, it does not wait for a reboot to "apply" the changes. parted writes to the drive immediately. If the file system on /dev/sdg was mounted when this operation was performed, the partition table and at least part of the file system structure will have been cached in RAM, which is why the files are still visible. If you reboot, the cached data will be lost and the file system will be completely gone.

It's more than likely that not all the file system structures were held in RAM when parted decided to trample all over them, which means you might get some really unpredictable results if you now try to access this file system. Ideally, you should treat it as corrupt and restore everything from backups.

I guess you could try copying as much as you can from that partition to another drive and then unmount and recreate the partition and file system. However, I would be hesitant to trust anything stored on a file system that's been manhandled by parted in this manner.

The message from fdisk is not an error, just a warning telling you that it doesn't handle GPT at all. fdisk can only do MBR; for GPT use something like parted or gdisk.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] command to control multiple services thirstonlinux Linux - Newbie 9 08-06-2013 08:04 PM
What is the command for Gnome volume control Budman21901 Linux - General 4 02-02-2006 11:21 AM
need to control a browser from the command line nephish Linux - Software 6 11-21-2005 05:55 PM
ndiswapper commandline mistype problem lnxusr Linux - Wireless Networking 11 03-04-2004 02:20 PM
>>> control mplayer with command args??? nibjb Linux - Software 0 07-16-2003 11:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:01 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