LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 06-20-2006, 11:29 AM   #1
webserverdude
LQ Newbie
 
Registered: Jun 2006
Location: ("Error: Cannot find city,state where name='webserverdude'")
Distribution: Fedora
Posts: 10

Rep: Reputation: 0
Re-Building /home Partitions


Hello fellow forum members,

Here is the problem:

I noticed that my mysql server was down when I was accessing my website. I checked logs, and it appears that the kernel had ran out of memory and had to kill the process of mysqld. So it got killed. I ran free and I saw that I had no swap. Turns out it hadn't activated at the beginning of installation. I had no more space so I tried to resize with parted without backing up my /home (the directory that existed in /dev/hda3). So I ran parted and ran:
Quote:
resize 3 12001.685 17002.526

It said that that drive had an incompatible feature enabled.
I googled that error and found that parted didintn support the results of using the
"sparse_super" option in mke2fs. So I ran this command according to a website:
Quote:
mke2fs -O ^sparse_super /dev/hda3

Main Point:

It started doing something I didnt want for it to do.
I undid the command by Ctrl-Z. Then I tried to undo the command by running the command without the "^" Then I tried mounting it. Couldn't find the partition in /etc/fstab I rebooted. Still FC4 couldn't find it. I booted in knoppix, and found the partition empty. The data I lost wasnt minor; I can survive without it. How would I go about rebuilding the partition, with new data?
 
Old 06-20-2006, 12:35 PM   #2
bernied
Member
 
Registered: Mar 2006
Location: Edinburgh, UK
Distribution: debian
Posts: 304

Rep: Reputation: 30
Quote:
The data I lost wasnt minor; I can survive without it.
I'm assuming that you're saying the data WAS minor - you don't want it back. If that's not what you meant, don't do the following.

If it were mine, I'd run fdisk from a live cd (slax is good and compact, so not too long to download, but any will do, most have fdisk), and delete the partition that you tried to resize.

Then create a new one, and make sure you've got a swap partition while you're there (the general rule is that it should be about 1-2 times the size of your actual memory, and anything over 1GB is wasted).
Then mk2fs on the new partition (read the man pages), or there are other filesystems.

Then check your /etc/fstab to make sure you're still trying to mount the right partitions if you've added one (the swap partition).

Then reboot (taking the cd out on the way).

Of course I take absolutely no responsibility for the outcome of any of this.
 
Old 06-20-2006, 12:43 PM   #3
bernied
Member
 
Registered: Mar 2006
Location: Edinburgh, UK
Distribution: debian
Posts: 304

Rep: Reputation: 30
I should have said that slax and probably other live cds will mount your hard drive on startup (probably to make it easy for you).
You should
Code:
umount /dev/hda*
before you do any of the above.
Running stuff like fdisk and parted on mounted filesystems will make you have a bad day (as you may already have found out).

You may also find cfdisk or qtparted as partitioning tools, but I've always found that parted does the better job, even though it looks the ugliest. It's a bit like ugly fruit - looks like s*!t, tastes great.
 
Old 06-20-2006, 01:16 PM   #4
webserverdude
LQ Newbie
 
Registered: Jun 2006
Location: ("Error: Cannot find city,state where name='webserverdude'")
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
I saw the info on /dev/hda3 on qt parted, and it turns out that the data, I guess, is still on there, It shows 311 MB of used space. Its type of FS is ext2. Do you think by changing the setting for teh home partition in /etc/fstab to ext2 might make the drive work? Is there a way to convert the fs to ext3 and not lose data and still have a chance of making it work?

Last edited by webserverdude; 06-20-2006 at 01:24 PM.
 
Old 06-20-2006, 01:45 PM   #5
bernied
Member
 
Registered: Mar 2006
Location: Edinburgh, UK
Distribution: debian
Posts: 304

Rep: Reputation: 30
I have found that if you delete a partition, then recreate it exactly the same as before (without formatting, or creating any filesystem on it), then the data is still there. Changing the partition doesn't seem to change the filesystem or the data, it just points to the beginning of the filesystem, so if you can restore that place, you might get your data back.

Try it.

And there are other ways of recovering data, but I don't know any specifics.
 
Old 06-20-2006, 02:17 PM   #6
webserverdude
LQ Newbie
 
Registered: Jun 2006
Location: ("Error: Cannot find city,state where name='webserverdude'")
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
I am doing all this partitioning stuff in qtparted. Which type of fs would I choose for the new partition? It seems as if you have to choose a filesystem. Would it be jfs, or xfs?
 
Old 06-20-2006, 08:43 PM   #7
webserverdude
LQ Newbie
 
Registered: Jun 2006
Location: ("Error: Cannot find city,state where name='webserverdude'")
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
***bump***
 
Old 06-20-2006, 09:23 PM   #8
webserverdude
LQ Newbie
 
Registered: Jun 2006
Location: ("Error: Cannot find city,state where name='webserverdude'")
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
Well, after some cruddy mistake I erased all the contents of the partition. Any tips on how to re-create it?
 
Old 06-21-2006, 03:21 AM   #9
bernied
Member
 
Registered: Mar 2006
Location: Edinburgh, UK
Distribution: debian
Posts: 304

Rep: Reputation: 30
Find a partitioning tool that you're comfortable with and use it to create a new partition, and remember to check that you have a swap partition as well - it was the lack of swap space that got you into this mess. Re-read my first post in this thread.

But do this from a live-cd, and not from your functioning system.
And make sure that none of the partitions on the drive that you're going to work on are mounted. Use:
Code:
$mount
to get a list of mounted devices.

qtparted, although pretty, sometimes does not work for me, so I stopped using it.

fdisk is functional and reliable, but looks clunky.

There is a live-cd called GParted that might work for you. But no recommendation from me cause I haven't tried it. But it is a very small live-cd (30MB), so won't take long to download. It is here:
http://gparted.sourceforge.net/

If you don't want to download anything or you don't have a cd burner, and you don't have any other live-cds lying around, you can try using your FC4 install disk - it may have a boot to cd function.
Just don't try and do this from your working system - you will have even more trouble.
And please, start to read the documentation for stuff before you use it. If you are googling, try adding the words guide or howto or documentation to your searches.
 
Old 06-21-2006, 09:33 AM   #10
webserverdude
LQ Newbie
 
Registered: Jun 2006
Location: ("Error: Cannot find city,state where name='webserverdude'")
Distribution: Fedora
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for all the help. I rebuilt the partition and it works normally. I will get to it right now. Thanks again for all your guys help. I will try to read the documentation more often.

Last edited by webserverdude; 06-21-2006 at 09:37 AM.
 
  


Reply

Tags
partitions


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
LXer: Building a heterogeneous home network for Linux and Mac OS X LXer Syndicated Linux News 0 06-10-2006 04:03 AM
LXer: Building an Asterisk@Home Test Lab LXer Syndicated Linux News 0 04-18-2006 04:33 AM
LXer: Building a Linux home media center LXer Syndicated Linux News 0 01-12-2006 11:46 AM
Building a home network with 2 Linux PCs and a D-Link smokylux Linux - Networking 4 06-26-2004 09:09 AM
mount / , /home , /home/usr on different partitions alekoos Slackware 14 05-03-2004 11:39 AM


All times are GMT -5. The time now is 03:06 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration