View Single Post
  #7  
Old 23rd June 2008, 08:29 AM
stevea Online
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,917
First - there is nothing wrong here.

For sdb - the fdisk tool attempts to read and interpret a 'DOS' type hard disk partition table. Your 2GB stick does not have a partition table - so fdisk reports garbage for the partiton entries of sdb. This is completely normal. Floppy disks don't have a partition tbl and the entire floppy is just one big FAT or FAT32 file system. Any storage device can either act as one big partition or else can have a partition tables - it's entirely up to you. If you want to install an /dev/sdc drive and format and mount /dev/sdc as an ext3 - then you don't have a partition tbl, and fdisk will not be able to show a partition tbl since none exists.

To repeat - your sdb doesn't not have a partition table and this is fairly common for USB sticks. Thinkof it as one big floppy. fdisk cannot print the partion tbl since none exists. This is not an error - it's completely normal. You could create a partiton tbl on /dev/sdb but you'd ruin the file system that is currently on there.

==

For sda you say ....
Device Boot Start End Blocks Id System
/dev/sda1 * 7347 9258 15358108+ 7 HPFS/NTFS
/dev/sda2 9259 19457 81923467+ f W95 Ext'd (LBA)
/dev/sda3 1 7197 57809871 83 Linux
/dev/sda4 7198 7346 1196842+ 82 Linux swap / Solaris
/dev/sda5 9259 19457 81923436 7 HPFS/NTFS

Partition table entries are not in disk order


fdisk reports partitions in the order of the partition tbl on disk.
The first block (MBR) holds the four "primary" partition entries. In linux these correspond with /dev/XXX1, /dev/XXX2, /dev/XXX3, and /dev/XXX4 , although not all primary partitions need to be enabled (then the /dev entry will not appear).


For your disk we have 4 primary partitions (in sector order):
/dev/sda3 1 7197 57809871 83 Linux
/dev/sda4 7198 7346 1196842+ 82 Linux swap / Solaris
/dev/sda1 * 7347 9258 15358108+ 7 HPFS/NTFS
/dev/sda2 9259 19457 81923467+ f W95 Ext'd (LBA)
--
Note that partition 2, /dev/sda2 is an extended partition.
An extended partition is a primary partition entry that may be further partitioned by an extended partition table. By design you can have an arbitrary number of "sub partitions" but in practice the typical Linux driver only handles 15 total. Primaries are always XXX1...XXX4, and extended partitions are XXX5...XXX15, extended starts at /dev/sda5 even if ther is no /dev/sda4 for example.

You have one "sub-partition" within /dev/sda2. Called /dev/sda5, it completely fills the /dev/sda2 "container".

===

No one would layout a disk the way yours is on purpose, but it often happens by "evolution". It is not a problem.

fdisk has a "sort partitions" command under the expert or extended command options. This would, in your case, change the primary partition order so sda1 is the in disk sector order ... cyl 1-7197 and so on. If you use this it WILL cause problems all over the place. grub.conf must be re-editied and anything that refers to the device name /dev/sdaN will have to be changed.

Also it's rather pointless to have an extended sda2 with only one big (sda5) partition. You may as well have made the big NTFS in /dev/sda2 as a primary.
==

In short - there is absolutely nothing wrong here and personally I wouldn't try to straighten out the partition order (a niggling detail) until the next time you install and OS or feel like re-installing Win.

Last edited by stevea; 23rd June 2008 at 08:37 AM.
Reply With Quote