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 03-14-2006, 10:46 PM   #1
phaeton
LQ Newbie
 
Registered: Jul 2003
Distribution: RedHat 9.0
Posts: 8

Rep: Reputation: 0
Unhappy Performed mkswap on / partition!


OK, please don't laugh. I was working on partitioning space and in my stupid actions I accidentally did mkswap /dev/hda3... unfortunately /dev/hda3 is mounted at /. If any of you have done this before... it looks exactly like doing rm -rf / except it doesn't remove the files (but the effect is the same, anything in shared memory still runs for a while).

Now my system is completely crippled. I don't really care that is has to be rebuilt, but I would really like to get some files off of there. The reason I know those files aren't gone is because the mkswap /dev/hda3 command took so little time its impossible it deleted 200gB of data in 0.0001s. It seems like the partition table is messed up. Is there ANY way to do this from a recovery CD or any sort of partioning software?

THANKS for any help!
 
Old 03-14-2006, 11:30 PM   #2
nadroj
Senior Member
 
Registered: Jan 2005
Location: Canada
Distribution: ubuntu
Posts: 2,539

Rep: Reputation: 60
how do you know the system is useless now? what errors are displayed when you boot? i wouldnt think that doing mkswap would screw it up completely... you have to also exectue the swapon command for it to start being used as swap space, no?

anyway.. if there ARE errors on boot.. get a live cd and post the contents of /etc/fstab and /etc/lilo.conf (or whatever grub file if it uses grub).

those are my suggestions.
again, i wouldnt think it would screw it up but you said it did so..
 
Old 03-15-2006, 08:43 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
According to man mkswap, the command turns an existing partition into swap space. As a minimum, that means the partition table is changed--this would not erase files, but it would stop you from seeing them. (MAYBE) all you have to do is just edit the partition table......

More when we see what fdisk -l says
 
Old 03-15-2006, 09:18 AM   #4
equinox
Member
 
Registered: Dec 2003
Location: Johannesburg, South Africa
Posts: 846

Rep: Reputation: 30
Well can't say I've ever done this. But boot off a livecd or rescue cd if you have and use fdisk to change the partition type.

fdisk -l will show that /dev/hda3 is swap. So use do fdisk /dev/hda, then press "t" to change the type, then choose partition number 3, and select "L" to give you a list of partition types. Choose "linux" which is code "83".

Hope that helps and goodluck. It's hit and miss heh .
 
  


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
Windows performed better - what am I doing wrong?! endif Linux - Newbie 12 06-25-2008 12:05 PM
Java - Halting a Program until an action is performed. logosys Programming 11 10-07-2005 03:17 PM
/sbin/mkswap: Permission Denied Ikebo Fedora 3 08-16-2005 11:11 PM
mkswap harakiri! lol Martin Strand Linux - Newbie 5 04-19-2005 01:59 PM
What is the most important task that should be performed on the Unix server? thatgentleman Linux - General 7 03-23-2002 09:02 PM

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

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