FedoraThis forum is for the discussion of the Fedora Project.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
parted /dev/sdb
(parted) p
mkpart primary 1GB 1.5GB
The parted command (when I print the details) outputs something like below:
1 2048MB .......
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.
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.
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
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.
Last edited by ravisingh1; 05-18-2013 at 10:12 PM.
/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.
do you mean that /dev/sdb can't be mounted if it is hard disk and not flash drive???????????????
Quote:
Originally Posted by michaelk
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.
Last edited by ravisingh1; 05-19-2013 at 07:59 AM.
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.
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
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.
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 .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.