what I want to bring in your notice that only 1 row came showing the complete size of the disk (detachable device) although I created 2 partitions with fdisk command.

The output of the below differs from above

Code:

fdisk /dev/sdb
(....): p

It outputs 2 rows as I created 2 partitions. Why then parted command doesn't show it and shows the total size of the disk.
Also, the above mkpart command shows some error something like 'too many partitions' (not very sure of the error)

My other question :
When I put a fresh pendrive (without partitioning) it shows as one. (I mean it doesn't show that there are any partitions as I havent created any which is fine). Now when I create a partition say /dev/sdb1 (of /dev/sdb) then the output of fdisk shows sdb1. What about the remaining space. Now after creating a partition (sdb1), why then only sdb1 can be mounted and not the other part. Because earlier when there was no partition , it had mounted the complete disk.

michaelk

05-18-2013 03:47 PM

It would help if you posted the actual output from the parted and fdisk commands i.e.

parted -l (use actual device ID if different)
fdisk -l

If you do not specify the entire size of the drive when creating a partition the unused space remains as unallocated. It isn't associated with a partition, does not have a device ID and therefore can not be formatted nor mounted.

I really can not follow the rest of the question. Typically, at least in the states flash drives are partitioned with a single partition and formatted. I do have a few drives that were already formatted but not partitioned. They mount just fine as ex. /dev/sdb.

ravisingh1

05-18-2013 10:01 PM

Quote:

Originally Posted by michaelk
(Post 4953918)

I really can not follow the rest of the question. Typically, at least in the states flash drives are partitioned with a single partition and formatted. I do have a few drives that were already formatted but not partitioned. They mount just fine as ex. /dev/sdb.

When you say you bought a flash drive in States, they are formatted but not partitioned. From your post it seems that we can say if it isn't partitioned, then it has single partition.

The rest of the question was related to this: Now you say the unpartitioned or single partitioned drive mounts fine as /dev/sdb. Right, here in Mumbai also, its the same way. What I more wanted to know was when I create a partiton say /dev/sdb1 (occupying 20% space of the total), then why now only /dev/sdb1 can mount. /dev/sdb doesn't come in picture anywhere except as a device file in the /dev directory (as /dev/sdb). When the partition sdb1 I created, does it mean the remaining space (80%) which earlier was formatted and working now become useless because the 80% doesn't come in picture anywhere.

Quote:

Originally Posted by michaelk
(Post 4953918)

If you do not specify the entire size of the drive when creating a partition the unused space remains as unallocated. It isn't associated with a partition, does not have a device ID and therefore can not be formatted nor mounted.

When I create partition using 'fdisk /dev/sdb' command, I never specified the entire size. Do we specify that also . If so, what's the point in specifying as we are to create a new partition, that's all.

michaelk

05-19-2013 06:41 AM

/dev/sdb references the entire drive which includes the master boot record and all partitions. The master boot record contains the boot code if any and the partition table. /dev/sdb can not mounted. Any partitions created i.e. /dev/sdb1 and formatted with a file system will be mountable.

Yes, if you modify the partitions i.e. create or resize /dev/sdb1 to 20% of the drive then the remaining 80% now becomes unallocated and unusable. It isn't part of the picture any more until you create another partition or resize an existing one.

Not to add confusion and what isn't normal is a flash drive that does not have any boot code or partition table. The entire drive i.e. /dev/sdb is formatted with a file system. In this case /dev/sdb can be mounted. I have several drives that came this way from the manufacture.

ravisingh1

05-19-2013 07:53 AM

Quote:

Originally Posted by michaelk
(Post 4954201)

/dev/sdb can not mounted.

do you mean that /dev/sdb can't be mounted if it is hard disk and not flash drive???????????????

Quote:

Originally Posted by michaelk
(Post 4954201)

Not to add confusion and what isn't normal is a flash drive that does not have any boot code or partition table. The entire drive i.e. /dev/sdb is formatted with a file system. In this case /dev/sdb can be mounted. I have several drives that came this way from the manufacture.

Whan an entire drive is formatted with a file system, then it w'd have boot block in it which may contain boot code and parition. If you partition a flash drive, it's obvious that the partition table is written in the boot block.
A file system contains 4 things: boot block, super block, inode block and data block.
I don't think there is any abnormality in flash drive as compared with hard drive with refernce to what we are talking because what holds data is filesystem and not partitions.

michaelk

05-19-2013 08:14 AM

Yes, if the flash drive is partitioned i.e. contains /dev/sdb1 then /dev/sdb can not be mounted.

So how is the drive actually partitioned. Please post the output of the command
fdisk -l (that is a small L)

rknichols

05-19-2013 01:00 PM

Quote:

Originally Posted by michaelk
(Post 4954231)

Yes, if the flash drive is partitioned i.e. contains /dev/sdb1 then /dev/sdb can not be mounted.

You have to be really careful when you make absolute statements like that. An ext2/3/4 filesystem does not store anything in the first 1KB block of its device or partition (allows for the installation of a boot loader there), so it is possible, albeit extremely unusual, to have a device with a small ext2/3/4 filesystem at the beginning and still have an MBR with a partition table defining one or more partitions that use the rest of the device.

As an experiment, I just formatted a 4GB flash drive with a 1/2 GB ext2 filesystem at the beginning (/dev/sdd) and a partition /dev/sdd1 using the rest of the device and formatted as VFAT. Either one can be mounted (but not both simultaneously). I find it hard to imagine a situation where it makes sense to do that, but it is possible.

michaelk

05-19-2013 01:29 PM

Exception noted.

ravisingh1

05-19-2013 10:28 PM

Quote:

Originally Posted by rknichols
(Post 4954366)

As an experiment, I just formatted a 4GB flash drive with a 1/2 GB ext2 filesystem at the beginning (/dev/sdd) and a partition /dev/sdd1 using the rest of the device and formatted as VFAT. Either one can be mounted (but not both simultaneously). I find it hard to imagine a situation where it makes sense to do that, but it is possible.

Please explain me how to create this: sdd and sdd1
Becz with fdisk i created partitions sdd1, sdd2 but never created sdd.

i had asked similar to this in earlier post (post # 3) in the thread but no one replied. See below:

Quote:

Originally Posted by ravisingh1
(Post 4954065)

When I create partition using 'fdisk /dev/sdb' command, I never specified the entire size. Do we specify that also . If so, what's the point in specifying as we are to create a new partition, that's all.

michaelk

05-20-2013 06:48 AM

/dev/sdd is the device ID for the drive itself and not a partition. It is automatically created when you plug the drive into the computer.

When creating partition you only need to specify its size.

PTrenholme

05-25-2013 08:38 PM

Is the OP actually using Fedora 9? Or was that a typo for Fedora 19? :scratch:

John VV

05-26-2013 12:42 AM

Also if this is the very dead fedora 9
they were still using /dev/hd?? AND /dev/sd??

if it is an ide drive in fedora 9 then the hd?? was used and NOT sd??

but please do your self a very big favor to your self
fedora 9 WILL cause all kinds of problems
You WILL be pulling your hair out and banging your head on the table .