LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 10-29-2011, 10:12 AM   #1
completed_tzinfe
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
A partition is unusable after cfdisk maximize


Hello,

A while ago I used cfdisk to partition my hard drive. During the partitioning, I told cfdisk to maximize the partition with my data (ext3), because it had some unallocated space before and after it.
As a result result, I cannot use the partition now.
I tried turning that option later on, however I still couldn't use it.
mount -t ext3 /dev/sda5 /media/sda5 says that the partition type is unknown.
gparted says that the partition type is unknown.
ext2explore (on windows) doesn't see this partition at all.
acronis disk director (on windows also) says that the partition is not formatted.

Thanks in advance
 
Old 10-29-2011, 10:30 AM   #2
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
You resized only the partition, but not the file system on it. Have a look at the resize2fs program, its purpose is to resize ext2/3/4 filesystems.
 
Old 10-29-2011, 06:07 PM   #3
completed_tzinfe
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
You resized only the partition, but not the file system on it. Have a look at the resize2fs program, its purpose is to resize ext2/3/4 filesystems.
Thanks for the fast reply, TobiSGD, but could you please be more specific about the way I need to use this program?

Here's what I get when I try to do it (as root, of course):
resize2fs /dev/sda5

resize2fs: Bad magic number in super-block while trying to open /dev/sda5
Couldn't find valid filesystem superblock.
 
Old 10-29-2011, 07:14 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
I never used that program, so I can only recommend to read the manpage for it with
Code:
man resize2fs
 
Old 10-29-2011, 08:51 PM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Hmmm - did you happen to take note of the warning(s) re using that (maximize) command ?.
I guess not.

Anything referencing the filesystem (like mount and resize2fs) I would think would expect it to be at the "start" of the partition. If you've expanded the partition in "front" of the filesystem, obviously this would no longer be the case.
resize2fs works fine when the partition is larger at the "end".

The following from the manpage has always been my primary concern when screwing around with partitions/filesystems:
Quote:
When recreating the partition, make sure you create it with the same starting disk cylinder as before! Otherwise, the resize operation will certainly not work, and you may lose your entire filesystem.
I would think you could loop mount the filesystem using an offset just to prove it is o.k. Could get fiddly, but would allow you to back everything up. Might then be easier just to mkfs and copy it all back - or you could try playing around to get the partition to again match the filesystem.

Last edited by syg00; 10-29-2011 at 08:55 PM. Reason: Forgot the loop mount suggestion.
 
1 members found this post helpful.
Old 10-30-2011, 03:54 PM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I would delete the partition, try with testdisk, and carefully choose the smaller partition to restore if testdisk spots it. You may end up with numbers out of sequence, but a little hacking of fstab fixes thatTestdisk has a static binary download, which has all the libs compiled in.

Then stop messing, & ignore messages as long as it works.
 
  


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
partition unusable after filesystem creation chaitanyajun12 Linux - General 12 11-29-2010 12:14 AM
[SOLVED] ubuntu 9.10 partition issue - unusable space eeeBu Linux - Newbie 8 11-21-2009 01:22 PM
resize partition with cfdisk or any other brgsousa Linux - Software 6 09-02-2008 01:28 AM
Partition using CFDISK ic_torres Linux - Newbie 3 07-24-2007 05:40 AM
slack 11 cfdisk partition ic_torres Slackware 6 04-21-2007 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

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