[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
parted-1.4.11 seemed to cause Invalid Media Type
From: |
Simon Dalley |
Subject: |
parted-1.4.11 seemed to cause Invalid Media Type |
Date: |
Thu, 07 Jun 2001 22:28:43 +0100 |
I have had a slight disaster when resizing a couple of FAT32 partitions.
I have a hard disk which _had_ a 779121KB (according to Linux fdisk)
FAT32 partition on hda1 (cylinders 1-97). This was C: under my Windows
95 OSR2.
It also had a D: drive, cyls 98-163, a logical partition of
530113KB which was also FAT32, on hda5.
I also had an E: drive (FAT16) on hda6.
hda7 - hda12 are GNU/Linux ext2 and swap partitions.
The extended partition is hda2 which contains the D: and E: drives
and all logical Linux partitions.
Since I was getting tight on space on C: but had plenty spare on D:, I
thought I would use parted to shrink D: (and hence the start of the
extended partition) so that I could expand primary partition C:.
The sequence of parted commands was something like
resize 5 840 1278.610
(previous start of 5 was around 780, no change to end)
(This gave 5 occupying 839.333 - 1278.610).
Then adjusted bottom of extended partition to correspond with new bottom
of D: drive:
resize 2 839.333 6181.259
(previous start of 2 was a smidgeon (=far less than a cylinder) less
that previous start of 5, end was unchanged from previous value)
(This resulted in 2 occupying 831.489 - 6181.259, starting about a full
cylinder less than I expected - clue?)
resize 1 0.031 831.489
(previous values for 1 were 0.031 to same value as prev. start of 2).
The overall result was as below:
/-------------
centaur:~ # /usr/local/sbin/parted -i /dev/hda
GNU Parted 1.4.11
Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public
License.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the GNU General Public License for
more details.
GNU Parted's development is supported by Conectiva, www.conectiva.com
Using /dev/hda
Warning: The operating system thinks the geometry on /dev/hda is
2482/255/63. Therefore, cylinder 1024 ends at
8032.499M. You should check that this matches the BIOS geometry before
using this program.
(parted) print
Warning: Unable to align partition properly. This probably means that
another partitioning tool generated an
incorrect partition table, because it didn't have the correct BIOS
geometry. It is safe to ignore,but ignoring
may cause (fixable) problems with some boot loaders.
Ignore Cancel ? i
Disk geometry for /dev/hda: 0.000-19470.937 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 831.489 primary FAT
2 831.489 6181.259 extended
5 839.333 1278.610 logical FAT
6 1278.642 1404.118 logical FAT
7 1404.150 1670.822 logical ext2
8 1670.854 1804.174 logical linux-swap
9 1804.206 2023.813 logical ext2
10 2023.845 4016.250 logical ext2
11 4016.281 5098.754 logical ext2
12 5098.786 6181.259 logical
3 6181.260 6196.948 primary ext2 boot
4 6196.948 19469.399 primary ext2
(parted) check 1
(parted) check 2
Error: Could not detect file system.
(parted) check 5
(parted) check 6
(parted)
---------------/
I then rebooted to w95 and observed that both my C: and D: drives
functioned beautifully with their new sizes.
I then repeated the operation on my backup disk and used dd to back up
/dev/hda1 and /dev/hda5 to identical partitions on the new disk.
Imagine my dismay to then discover that my _E:_ drive (/dev/hda6)
could no longer be
read by windows. It gave something like "there has been a device failure
on this disk". Booting from a w95 floppy gave no problems with dir
command on C: and D:, but dir on E: gave
Invalid media type error
Abort, Retry, Fail ?
Rebooting under Linux, I was able to mount and access this partition
with no problems at all, thank goodness.
For what it's worth, the output of Linux fdisk is shown below:
/---------------
centaur:~ # fdisk /dev/hda
The number of cylinders for this disk is set to 2482.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): p
Disk /dev/hda: 255 heads, 63 sectors, 2482 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 106 851413+ b Win95 FAT32
/dev/hda2 107 788 5478165 5 Extended
/dev/hda3 * 789 790 16065 83 Linux
/dev/hda4 791 2482 13590990 83 Linux
/dev/hda5 108 163 449820 b Win95 FAT32
/dev/hda6 164 179 128488+ 6 FAT16
/dev/hda7 180 213 273073 83 Linux
/dev/hda8 214 230 136520+ 82 Linux swap
/dev/hda9 231 258 224878 83 Linux
/dev/hda10 259 512 2040223 83 Linux
/dev/hda11 513 650 1108453 83 Linux
/dev/hda12 651 788 1108453 83 Linux
Command (m for help): q
-----------/
I then tarred all files off E: (hda6) to a tarfile on hda12.
Rebooting in full windows95, I ran w95 FDISK in a DOS box. This showed
one DOS partition, one extended partition and 2 non-DOS partition in the
primary entries. The extended partition displayed as _empty_ in spite of
windows being able to see D: just fine.
Then tried (in the dos box) doing format e:. Appeared to run fine - gave
nice new empty filesystem.
Rebooted in linux, ran fdisk. Alas, most of the extended partitions were
gone altogether:
/-----
Warning: invalid flag 0x0000 of partition table 6 will be corrected by
w(rite)
Command (m for help): p
Disk /dev/hda: 255 heads, 63 sectors, 2482 cylinders
Units = cylinders of 16065 * 512 bytes
Device Boot Start End Blocks Id System
/dev/hda1 1 106 851413+ b Win95 FAT32
/dev/hda2 107 788 5478165 5 Extended
/dev/hda3 * 789 790 16065 83 Linux
/dev/hda4 791 2482 13590990 83 Linux
/dev/hda5 108 163 449820 b Win95 FAT32
------/
Parted gave:
/---------
(parted) print
Error: Invalid partition table on /dev/hda - wrong signature 0
Ignore Cancel ? i
Disk geometry for /dev/hda: 0.000-19470.937 megabytes
Disk label type: msdos
Minor Start End Type Filesystem Flags
1 0.031 831.489 primary FAT
2 831.489 6181.259 extended
5 839.333 1278.610 logical FAT
3 6181.260 6196.948 primary ext2 boot
4 6196.948 19469.399 primary ext2
(parted)
----------/
It is definitely a bug that /dev/hda6 (my E:) became inaccessible
under W95 after adjusting the boundary between C: and D: with parted,
wouldn't you think?
I am useing Suse 6.2 distribution.
If there is any more info that I can provide, please let me know.
Maybe documentation could be improved too? It was not clear about the
order things should be done in where moving extended partitions was
concerned.
Backups are, indeed, a Good Thing. All the best for Parted, the GPL,
and Free Software.
Best regards,
Simon
--
Simon Dalley CEng MIEE, address@hidden
tel +44 (0) 1235 816206
- parted-1.4.11 seemed to cause Invalid Media Type,
Simon Dalley <=