LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 05-18-2013, 10:40 AM   #1
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 278

Rep: Reputation: Disabled
"parted" command not working in Fedora9


I ran the foll. command:
Code:
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.
 
Old 05-18-2013, 03:47 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,899

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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.

Last edited by michaelk; 05-18-2013 at 03:50 PM.
 
Old 05-18-2013, 10:01 PM   #3
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 278

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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 View Post

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.
 
Old 05-19-2013, 06:41 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,899

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
/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.
 
Old 05-19-2013, 07:53 AM   #5
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 278

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
/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 View Post
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.
 
Old 05-19-2013, 08:14 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,899

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
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)
 
Old 05-19-2013, 01:00 PM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 1,437

Rep: Reputation: 599Reputation: 599Reputation: 599Reputation: 599Reputation: 599Reputation: 599
Quote:
Originally Posted by michaelk View Post
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.
 
Old 05-19-2013, 01:29 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,899

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
Exception noted.
 
Old 05-19-2013, 10:28 PM   #9
ravisingh1
Member
 
Registered: Apr 2013
Location: Mumbai
Distribution: Ubuntu13.10
Posts: 278

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by rknichols View Post

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 View Post
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.
 
Old 05-20-2013, 06:48 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,899

Rep: Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746Reputation: 746
/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.
 
Old 05-25-2013, 08:38 PM   #11
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,150

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
Is the OP actually using Fedora 9? Or was that a typo for Fedora 19?
 
Old 05-26-2013, 12:42 AM   #12
John VV
Guru
 
Registered: Aug 2005
Posts: 12,916

Rep: Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715Reputation: 1715
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 .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Missing menu for "Removable Disks and Media Preferences" in Gnome: Fedora9 awmian Linux - Newbie 1 09-08-2008 12:34 PM
question: fedora9 = "too soon" ??? (for phenom 9850 / livna / updates / other) maxreason Fedora 7 06-10-2008 07:18 PM
net working eth0 eth1 wlan0 "no connection" "no LAN" "no wi-fi" Cayitano Linux - Newbie 5 12-09-2007 07:11 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
Does anyone know how to use the "parted" command in RH? WorldBuilder Linux - Software 3 05-06-2003 09:52 AM


All times are GMT -5. The time now is 01:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration