[TriLUG] screwed disk

Joseph Mack NA3T jmack at wm7d.net
Thu Apr 5 21:31:28 EDT 2007


On Thu, 5 Apr 2007, Alan Porter wrote:

>> Alan - what are you going to see if you partition / into the swap area -
>> are you going to see junk directory entries? What if your partition is
>> short?
>
> You will not be able to mount the partition unless the starting point
> is correct.  Otherwise, you'll see some error message from mount,
> something like "mount: wrong fs type, bad option, bad superblock
> on /dev/hda1".

confirmed

in the interests of science I partitioned a zip disk into 3 
partitions (/,swap,/usr) formatted them (ext3, mkswap, 
ext3), put a couple of directories and files into the ext3 
partitions, filled the rest of each partion with a file from 
/dev/zero, deleted the zero'ed file, unmounted the partions, 
deleted all the partitions, exited fdisk, re-entered the 
original partition table by hand and confirmed that I could 
mount all the partitions (ro), that all files were there and 
there was no garbage seen with ls in any directory.

I then confirmed that if I didn't start the partition at the 
right block, I couldn't mount it (Alan's statement).

If the partition was short or long (by one block) the 
directories and files were all there and there was no 
garbage listed in the directories (all the used inodes are 
at the beginning of the partition?).

The interesting piece of information is that if you do df on 
the mounted disk with the long or short partition, that the 
partition size shown (blocks) is the correct one for the 
original partition and not the size of the partition as is 
in the partition table. So once you have the start of the 
partitions, then you make a rough guess as to the size of 
the partition, then when you mount it, you will see the real 
size of the partition.

I do my windows backups with dd and I remember that as I 
restore (with dd onto a disk with just the partition table) 
that as soon as I start the restore, that I can mount the 
disk while I'm dd'ing and see the files and directories with 
ls. All (most?) of the directory information must be really 
early in the partition.

Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list