Find the answer to your Linux question:
Results 1 to 2 of 2
Yesterday I went to update my file server from RH9 to FC4. The hard drive had a 50G partition at the end, and in the setup I rearranged just about ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2005
    Posts
    1

    Partition messed up.. looking for advise before I sfdisk


    Yesterday I went to update my file server from RH9 to FC4. The hard drive had a 50G partition at the end, and in the setup I rearranged just about all the other partitions, but left the fifty gigger alone. The install hung, for a very long time, just before the install of packages. So I rebooted. Now, at start up, it dumps errors when checking for ide drives. fdisk /dev/hde (hde because it is attached thru a pci ide card) says device not found. sfdisk -l /dev/hde gives output, but includes "cannot read sector 45255105".

    here is some sfdisk output
    Code:
    $ sfdisk -l -x -uS /dev/hda
    Device Boot    Start       End   #sectors  Id  System
    /dev/hde1 *       63     208844    208782  83  Linux
    /dev/hde2     208845   20691719  20482875  83  Linux
    /dev/hde3   20691720   41174594  20482875  83  Linux
    /dev/hde4   41174595  156296384 115121790   f  Win 95 Ext'd (LBA)
    
    /dev/hde5   41174658   43214849   2040192  83  Linux
    -           43214850   45255104   2040255   5  Extended
    -           41174595   41174594         0   0  Empty
    -           41174595   41174594         0   0  Empty
                            
    /dev/hde6   43214913   45255104   2040192  83  Linux
    -           45255105   47295359   2040255   5  Extended
    -           43214850   43214849         0   0  Empty
    -           43214850   43214849         0   0  Empty
    Ok, some things to note. In output from this (healthy) computer I am on right now, the last partition does not have another Extended partition, it has three lines of Empty. Two, e5 and e6 are each just one gig, but hde4 is the ~60G extended.

    So, First Q... on my healthy computer, the extended partition is type '5', and just called 'Extended', no mention of LBA. So, what the difference?

    And I have a couple of solution ideas, let me know what you think. First, I was thinking of using sfdisk to change hde6 to be as big as the rest of the space. If I can at least get the drive to act normal, I can copy /dev/hde6 to somefile.dat. This file would be like 60 gigs big. The contents will be a couple of partitions garbled together, I know. But I can write a utility to find the beginging of an etx3 partition and then read out the file. With some luck, I can crop the somefile down to a trimmed file that represents just the original partition. (I am a software engineer. I don't know much about ext3, but I will learn if that's what it takes to recover this data), and then I can mount the file.

    My concern is, does sfdisk just write in the partition space? I want to make sure that it doesn't write anywhere else in the data. I'm pretty sure it won't because that's what mkfs utilities should dov(I think), but I figure I better ask an expert.

    Also, and maybe I should leave this alone, but I was thinking of changing the extended partition to be type '5'. Why, I don't know, but it seems to be the working type on my healthy pc. And would be consistent with the other partitions.

    Any help, hints, advise on this are much appreciated.

    Until then,
    James.

  2. #2
    Just Joined!
    Join Date
    Aug 2005
    Location
    Berkshire, UK
    Posts
    80
    I've never seen this partition type 5 used - any idea how the partitions got set up in the first place.
    Also I've never seen these 'empty' lines.

    I use fdisk, not sfdisk, since that's all there was when I started, and all my partitions are simple with no 'odd' lines. The 'empty' lines could be a display manifestation of sfdisk for displaying space which is a logical extension of a partition.

    I add a listing of one of my HDDs to show what it looks like for fdisk:
    Disk /dev/hda: 120.0 GB, 120034123776 bytes
    255 heads, 63 sectors/track, 14593 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/hda1 1 7 56196 83 Linux
    /dev/hda2 * 8 454 3590527+ b W95 FAT32
    /dev/hda3 455 977 4200997+ 83 Linux
    /dev/hda4 978 14593 109370520 f W95 Ext'd (LBA)
    /dev/hda5 978 1870 7172991 7 HPFS/NTFS
    /dev/hda6 1871 2131 2096451 b W95 FAT32
    /dev/hda7 2132 4681 20482843+ b W95 FAT32
    /dev/hda8 4682 7869 25607578+ b W95 FAT32
    /dev/hda9 7870 11057 25607578+ b W95 FAT32
    /dev/hda10 14000 14509 4096543+ 83 Linux
    /dev/hda11 14510 14593 674698+ 82 Linux swap

    I would have thought that your best bet might be to boot from a CD and do an fsck from there as first resort:
    first just scan to see wht errors it show
    then do a fix run and see how it turns out.

    Have u tried System Rescue CD?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •