LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-21-2011, 08:22 PM   #1
mei0fei
Member
 
Registered: Jul 2011
Posts: 38

Rep: Reputation: Disabled
why unable to open /dev/sda5(6) using fdisk?


administrator@ubuntu:/dev$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/loop0 7.5G 4.4G 2.8G 61% /
none 431M 640K 431M 1% /dev
none 438M 192K 438M 1% /dev/shm
none 438M 104K 438M 1% /var/run
none 438M 0 438M 0% /var/lock
/dev/sda6 32G 15G 18G 46% /host
/dev/sda5 32G 9.0G 24G 29% /media/软件
administrator@ubuntu:/dev$ fdisk /dev/sda5

Unable to open /dev/sda5
 
Old 07-21-2011, 09:07 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Because it's a partition, and fdisk only operates on whole devices.
 
Old 07-21-2011, 09:23 PM   #3
mei0fei
Member
 
Registered: Jul 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
o, thank you! but where can I find the whole device? I have only a hard disk on my computer. I want to list partitions on this hard disk using fdisk.
 
Old 07-21-2011, 09:31 PM   #4
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,130
Blog Entries: 2

Rep: Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825Reputation: 4825
The whole disk is /dev/sda so that the command to list the partitions on it is
Code:
sudo fdisk -l /dev/sda
 
Old 07-21-2011, 09:33 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
The simple rule here is: use the device you saw/wanted, and chop of the digit.
So, instead of
Code:
fdisk /dev/sda5
do
Code:
fdisk -l /dev/sda
That's the raw (whole) device, the numbers you see are the numbers
of the respective partitions.

I added that -l as a "safety measure". While you can obviously
use fdisk and then interactively display the information you're
after, it's safer to use the -l switch, which makes fdisk output
the partition table and some other information, and quit. No risk
of accidentally re-writing (destroying?) your partitioning.



Cheers,
Tink

Last edited by Tinkster; 07-21-2011 at 09:46 PM. Reason: friggin axidupes w/in a post :/
 
Old 07-21-2011, 10:03 PM   #6
mei0fei
Member
 
Registered: Jul 2011
Posts: 38

Original Poster
Rep: Reputation: Disabled
thank you! I see the partitions on my hard disk.
 
  


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
MacBook Pro - fdisk: Unable to open /dev/sda totalboon Slackware - Installation 5 01-04-2011 03:34 AM
Readjust disk space between /dev/sda2 and /dev/sda5 born2bdesi Linux - Newbie 23 12-21-2010 12:40 AM
fdisk: unable to open /dev/hda andykerouac Linux - Newbie 7 07-18-2008 08:49 AM
fdisk unable to read /dev/sda frankie_DJ Slackware 1 09-08-2005 09:44 PM
unable to fdisk /dev/hdc aqoliveira Red Hat 4 10-01-2003 05:12 AM


All times are GMT -5. The time now is 04:02 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration