LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-28-2015, 06:18 PM   #1
Optyx
Member
 
Registered: Jan 2004
Location: Sydney, Australia
Distribution: Slackware 6
Posts: 95

Rep: Reputation: 15
Thumbs down 750GB NTFS set to linux-swap by accident.


So I was really drunk and playing with a few things on my laptop.
Unbeleivable stupidity on my part.




Please tell me this is reversible somehow.

Steps I've taken :

Booted, halted & swap-offd' / resumed.
- has not been initalised yet.

Downloaded parted, ran a scan which was not fruitious.
Scan showed 3 results. 1 400mb and 2 3mb - non mountable.


It was my thought that only the start of cylinders / head are written for partitions(in theory). I'm guessing this is something that isn't so *only* when you turn the entire drive in to swap partition. I could cry.

Code:
The partition in question : 
Disk /dev/sdb1: 721GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system     Flags
 1      0.00B  721GB  721GB  linux-swap(v1)

print -a

Code:
(parted) rescue                                                           
Start? 512B                                                               
End? 4096B                                                                
(parted) print all                                                        
Model: SanDisk Cruzer Glide (scsi)
Disk /dev/sda: 7849MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start  End     Size    Type     File system  Flags
 2      125kB  32.6MB  32.5MB  primary  fat16        esp


Model: ATA TOSHIBA MQ01ABD0 (scsi)
Disk /dev/sdb: 750GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start  End    Size    File system     Name                  Flags
 1      827MB  722GB  721GB   linux-swap(v1)  Basic data partition
 4      722GB  738GB  15.7GB  ext4                                  boot, esp
 2      738GB  748GB  10.5GB  ext4
 3      748GB  750GB  1828MB  fat32


Model: Unknown (unknown)
Disk /dev/sdb1: 721GB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system     Flags
 1      0.00B  721GB  721GB  linux-swap(v1)

Last edited by Optyx; 03-28-2015 at 06:20 PM. Reason: codified
 
Old 03-28-2015, 06:35 PM   #2
linosaurusroot
Member
 
Registered: Oct 2012
Distribution: OpenSuSE,RHEL,Fedora,OpenBSD
Posts: 982
Blog Entries: 2

Rep: Reputation: 244Reputation: 244Reputation: 244
The first thing to do is back it up (for instance with dd) so you can work on it (or have someone else do so) without risking further loss.

photorec is often suggested as a means of recovering files from a damaged filesystem.
 
1 members found this post helpful.
Old 03-28-2015, 07:17 PM   #3
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,786

Rep: Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216Reputation: 2216
If all you did was "mkswap /dev/sdb1" (or the equivalent in a GUI partitioning tool) and never actually used the partition for swap, then testdisk should be able to find the backup NTFS boot sector and repair the filesystem. Backing up the entire disk is still highly recommended. It is really easy to make a mistake with testdisk and cause further damage.
 
  


Reply

Tags
parted, partioning, recovery, rescue data, swapfile


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
grub skips hd1 after swap 250GB with 750GB bostondriver Linux - General 6 02-04-2008 11:25 AM
Format external 750GB HD in Windows for linux corewin Linux - Newbie 2 11-16-2007 02:30 PM
ntfs swap ? darinbolson Linux - General 3 07-04-2006 09:10 AM
chsh accident; big accident. shinystuffrox *BSD 3 06-06-2005 07:06 AM
Swap file format (by accident, honest) and boot maxb Linux - General 3 08-01-2003 04:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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