LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-07-2004, 08:00 PM   #1
dee999
LQ Newbie
 
Registered: May 2004
Posts: 2

Rep: Reputation: 0
whoops! mistake using parted


My partition table is now corrupt (due to user error), but I am still up&running - howcan i best rectify the situation? I have the output of parted, 'print' from before i messed it up.

This is what I did - I was repartitioning my HDD using parted as follows:
(i) i resized an existing partition (shrunk dev/hda5)
(ii) then i thought i'd add a new partition (i thought this would be /dev/hda8, but sit between 5 and 6 on the disk) in the available space by
> mkpart logical ext2 39000.001 56266.721 [- the available bit of disk]

it didn't like logical so i accepted 'extended'. Now my partition table on /dev/hda reads

Disk geometry for /dev/hda: 0.000-57231.562 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 39001.553 56266.721 extended lba

but the other partitions are still there but i have to first 'select /dev/hda2...etc' - which i didn't have to do previously. [ also /dev/hda5 doesn't exist...]

the fact that i don't really understand makes me leary of any further messing - at this stage i'm sure its easy to put right, but maybe not if i start to play....

how do i get my old partitions back? (and - to help me understandwhat is going on why do i now have a different _type_ of output from print?)

thanks for help in my hour of need.
dee
 
Old 05-07-2004, 08:06 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
Hardrives can only have 4 partitions normally. This of course is a problem so A special extended partition type is used. Within this partition you can add logical partitions. Normal partitions ( either extended or not ) have values from hda1 to hda4, logical partitions always start counting from 5.

i.e.
hda1
hda2 ( ext'd contains 5 and 6 ).
---hda5
---hda6
hda3

This best thing to do is reset the values back to what they where, and back up everthing in the partitions your going to be messing with ( and the ones after them ) and setup the disk how you like it then restore everthing back.
 
Old 05-08-2004, 07:25 AM   #3
dee999
LQ Newbie
 
Registered: May 2004
Posts: 2

Original Poster
Rep: Reputation: 0
i thought i understood about the logical, extended partitions, which is why i was asked for a logical partition
this is what it llooked like before i started messing with parted:
part
Disk geometry for /dev/hda: 0.000-57231.562 megabytes
Disk label type: msdos
Minor Start
End Type Filesystem Flags
1 0.031 5718.449 primary ext2 boot
2 5718.450 15257.043 primary ext2
3 15257.043 24795.637 primary lba
4 24795.637 57231.562 extended
5 24795.668 56266.721 logical ext2
6 56266.752 56745.219 logical ext2
7 56745.250 57231.562 logical linux-swap
(parted)

i shrank 5, and was trying to put another logical partition in the physical space freed between 5 and 6, but for reasons that are not clear to me, that failed.

my problem is that if i run
select /dev/hda1
mkpart primary ext2 0.031 5718.449

(imo apparently turning it back to the original)
i get the follwing message:
Error: Can't create any more partitions.


which indicates to me there is somethng i do not understand about what i thought i was doing (confirming this from having got here in the first place...)

as i indicated if i select /dev/hda and 'print'
i get

Disk geometry for /dev/hda: 0.000-57231.562 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 39001.553 56266.721 extended lba

(and no longer the complete list above) however i can select /dev/hda2

Disk geometry for /dev/hda2: 0.000-9538.593 megabytes
Disk label type: loop
Minor Start End Filesystem Flags
1 0.000 9538.593 ext2

(right size, for some reason now 'loop')

To proceed should i
select /dev/hda
rm 1
mkpart primary ext2 0.031 5718.449


as i still sitting on a functioning system i am leary of doing anything that says remove by boot partition.

tia
 
Old 05-08-2004, 08:22 PM   #4
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
This is dangerous stuff but...

You can rewrite the whole partition table ( removing then adding back in the partitions ). But this can go wrong ( So don't blame me! ). Theres another option which is rescue ( See parted manual ) Which may be better.

Resizes are never the best bet. When you accepted extended it seems to have wiped the partition ( Logical was correct ). Logical partitions have space available either side of them, also the have to end or start on a cylinder, which may have been why parted wouldn't accept the new partition as it was.

To achieve what you want, I'd of backuped 5 and 6 removed the 5, 6, 7 partitions. and added the new ones back in. You can try to set what you want now though 6 ( now 7 ) will be the hardest to set right.

8 wouldn't be the new partition, it would be 6, ( 6 and 7 would of been increased to 7 and 8 ).

Last edited by leonscape; 05-08-2004 at 08:35 PM.
 
  


Reply


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
Whoops! acey99 Linux - General 5 11-13-2005 03:55 PM
Whoops with prelink andrewjg Linux - Software 2 03-02-2005 07:16 PM
Whoops! Xandros Boot disk? I-LiKe-LiNuX Linux - Software 0 07-15-2004 01:45 PM
Whoops! megaspaz General 3 10-31-2003 10:58 AM
Whoops - yanc mistake and can't load X asktoby Linux - Software 11 07-31-2003 01:49 PM

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

All times are GMT -5. The time now is 04:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration