LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 05-01-2004, 02:59 PM   #1
geniarse
Member
 
Registered: May 2003
Location: UK
Distribution: Gentoo
Posts: 141

Rep: Reputation: 15
Exclamation Partition problems


despite using linux exclusively for over a year I still had an old FAT partitiion knocking around. So I decided to get rid of it finally, I used the Mandrake partitioning tool (I'm running slackware now) but for whatever reason it produced an error message and my machine crashed. now looking at the partitions using fdisk:

/dev/hdb1 * 1 62443 31471240+ f W95 Ext'd (LBA)

/dev/hdb2 62444 119150 28580328 83 Linux
/dev/hdb3 62444 119133 28571602+ 0 Empty

/dev/hdb5 1 10424 5253192 83 Linux
/dev/hdb6 10424 12511 1052226 82 Linux swap
/dev/hdb7 12512 29182 8401963+ 83 Linux
/dev/hdb8 29182 45853 8401963+ 83 Linux
/dev/hdb9 45854 62443 8361328+ 83 Linux

I've highlighted the interesting bit, it appears that the partioning didn't complete and I have 2 partitions in the same space both of which I can mount. The partition marked empty is the old partition (with all the old files still on it) and the other is the new partition. Does anyone know of a safe method of correcting this, I don't want to have to begin my system fom scratch.

thank god I backed up
 
Old 05-01-2004, 04:44 PM   #2
Abject
Member
 
Registered: Mar 2002
Location: Studio City, CA
Distribution: Debian (Sarge-Sid)
Posts: 76

Rep: Reputation: 15
The data on these partitions is no longer useful, right? It sounds like that from your post.
[list=1][*]A safe method would be any method that began with backing up all the useful partitions on that device. So do that. Do it now.[*]Next, download and burn a copy of Knoppix or some other bootable Linux "Live CD," so that you have a chance of fixing stuff if you do gronk your drive (assuming you have a bootable CD drive). This has saved my bacon more than twice, when I ignored Step 1. It'll also be handy if you totally trash your drive, and you did remember Step 1. Be sure you back it up using an application that is also on the CD.[*]OK. Install GNU/parted if you don't have it.[*]Reboot your box in single-user mode. For LILO, it's:
Code:
boot: Linux vga=normal s
Dunno about the GRUB. Make sure both partitions are umount'ed[/list=1]

Now, run parted:
Code:
# parted /dev/hdb
If you are not familiar with parted, just type
Code:
(parted) help
I'd start with
Code:
(parted) print
Write down the start and end blocks of each partition, in case you need to rescue one or some. Next, you have choices like:
Code:
  check MINOR                   do a simple check on the filesystem
  cp [FROM-DEVICE] FROM-MINOR TO-MINOR      copy filesystem to another
        partition
  help [COMMAND]                prints general help, or help on COMMAND
  mklabel LABEL-TYPE            create a new disklabel (partition table)
  mkfs MINOR FS-TYPE            make a filesystem FS-TYPE on partititon MINOR
  mkpart PART-TYPE [FS-TYPE] START END      make a partition
  mkpartfs PART-TYPE FS-TYPE START END      make a partition with a filesystem
  move MINOR START END          move partition MINOR
  name MINOR NAME               name partition MINOR NAME
  print [MINOR]                 display the partition table, or a partition
  quit                          exit program
  rescue START END              rescue a lost partition near START and END
  resize MINOR START END        resize filesystem on partition MINOR
  rm MINOR                      delete partition MINOR
  select DEVICE                 choose the device to edit
  set MINOR FLAG STATE          change a flag on partition MINOR
I'd probably try rm'ing both of those partitions, if they show up. Be warned that parted complains a lot. You need to read it's complaints carefully, there is usually a clue or two in it.

Also, be aware that parted is not like fdisk - it does what you tell it, right away, so be careful and thoughtful.
 
Old 05-01-2004, 05:41 PM   #3
geniarse
Member
 
Registered: May 2003
Location: UK
Distribution: Gentoo
Posts: 141

Original Poster
Rep: Reputation: 15
Yeah I was gonna do that (though parted seems alot better than fdisk) but wondered if there was a better less risky way (i have never been comfortable with partitions one stupid mistake and you're buggered and I make stupid mistakes alot).

Right I should have mentioned his before, bu the 2 partitions are no the end of my problems the partiion table is in someway corrupted according to parted:
Warning: Unable to align partition properly. This probably means that another
partitioning tool generated an incorrect partition table, because it didn't havethe correct BIOS geometry. It is safe to ignore,but ignoring may cause
(fixable) problems with some boot loaders.

do you think erasing the 2 bad partitions will fix this or is this a bigger problem
 
Old 05-01-2004, 07:54 PM   #4
Abject
Member
 
Registered: Mar 2002
Location: Studio City, CA
Distribution: Debian (Sarge-Sid)
Posts: 76

Rep: Reputation: 15
Quote:
do you think erasing the 2 bad partitions will fix this or is this a bigger problem
I think it'll fix it. parted did say it was safe to ignore, except for "some boot loaders." I don't know which ones, either....

But, the backup's still a good idea.
 
Old 05-03-2004, 06:19 AM   #5
geniarse
Member
 
Registered: May 2003
Location: UK
Distribution: Gentoo
Posts: 141

Original Poster
Rep: Reputation: 15
I've done the re-partition and everything went fine. Just the little problem about partitions being misaligned still around. But I suppose I'll have to ignore it and hope my hard drive doesn't blow up anytime soon. Unless anyone else knows of a none destructive way of fixing this.
 
Old 05-03-2004, 10:26 PM   #6
Abject
Member
 
Registered: Mar 2002
Location: Studio City, CA
Distribution: Debian (Sarge-Sid)
Posts: 76

Rep: Reputation: 15
I've had this with every Linux partition ever created by PartitionMagic (great for Windows, sucks for Linux). The only way to stop parted's whining is to let it re-partition. The price is too high, I say. Let it whine.
 
Old 05-04-2004, 05:12 AM   #7
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
Now that you've got it all sorted...

I couldn't help but notice that you put your extended partition as the first partition. Odd, but okay I guess.

Second, all you had to do was to run fdisk /dev/hdb as root and delete partition #2. That would have done it, no need for parted or anything else.

I just tried it on my machine and it worked (I did everything except "w" for "write" to the partition table - no complaints from fdisk)

It wouldn't have affected your extended partition, which by the way, looks pretty good now that I've looked at it .

You would have had to make sure that you had fstab edited properly, but that was expected...


Reprint your partition table if you don't mind, I would be interested in seeing what it looks like now.


John
 
Old 05-04-2004, 05:50 AM   #8
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
Quote:
Originally posted by Abject
I've had this with every Linux partition ever created by PartitionMagic (great for Windows, sucks for Linux). The only way to stop parted's whining is to let it re-partition. The price is too high, I say. Let it whine.
Huh, no complaints here. Especially since rebuilding my Toshiba from the factory disks:

a) Wipes out every partition. Linux included.
b) Recreates one large partition. In NTFS no less.

Okay, so I could have bought the full version of XP just avoid this (maybe). Not.


So I got Partition Magic, shrank the original partition, split the remainder up into several pieces, made my linux partitions (Ext3 & swap), formatted them, and converted my NTFS partition to FAT32.

All in one swip. And no misalignment problems either.


I don't think that parted is quite up to that level of performance.


John
 
Old 05-06-2004, 05:31 PM   #9
geniarse
Member
 
Registered: May 2003
Location: UK
Distribution: Gentoo
Posts: 141

Original Poster
Rep: Reputation: 15
Partition table as requested

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 62443 31471240+ f W95 Ext'd (LBA)
/dev/hdb2 62444 119150 28580328 83 Linux
/dev/hdb5 1 10424 5253192 83 Linux
/dev/hdb6 10424 12511 1052226 82 Linux swap
/dev/hdb7 12512 29182 8401963+ 83 Linux
/dev/hdb8 29182 45853 8401963+ 83 Linux
/dev/hdb9 45854 62443 8361328+ 83 Linux

As for why extended first patrtition ask windows 2000 which kindly corrupted both my old windows partition and linux partitions (prompting my complete dedication to linux, sodding compatibility plus it helped college started using openoffice)
 
Old 05-06-2004, 07:30 PM   #10
rootboy
Member
 
Registered: Oct 2001
Distribution: Mint 15
Posts: 770

Rep: Reputation: 51
The partition looks good to me, I can't see anything wrong with it (not that this should comfort you in the least).

You could use sysresccd to back everything up and redo your partitions from scratch.

http://www.sysresccd.org

But don't forget the old saying (adapted for linux),

"If it works, don't fdisk with it"


John
 
  


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 problems jespr Linux - Newbie 6 10-13-2005 02:59 AM
partition problems in FC@ spookyechc Fedora 1 10-14-2004 10:35 AM
Partition problems DarkSun4241 Linux - Newbie 4 08-04-2004 04:20 PM
Partition problems mistahemu Linux - General 1 03-31-2003 10:30 AM
help! partition problems! Aman9090 Linux - Newbie 1 09-20-2002 06:03 PM

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

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