LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 05-18-2006, 05:58 AM   #1
Vragec
LQ Newbie
 
Registered: May 2006
Posts: 2

Rep: Reputation: 0
disk info


How to read disk info(e.g. size, type, name, partitions, mount point, ... ) in c ?

without df

Last edited by Vragec; 05-18-2006 at 06:01 AM.
 
Old 05-18-2006, 06:29 AM   #2
xcore_on
Member
 
Registered: Mar 2006
Posts: 96

Rep: Reputation: 15
maybe fdisk -l work for you
 
Old 05-21-2006, 05:43 PM   #3
SkyEye
Member
 
Registered: Sep 2005
Location: Sri Lanka
Distribution: Fedora (workstations), CentOS (servers), Arch, Mint, Ubuntu, and a few more.
Posts: 441

Rep: Reputation: 40
Quote:
Originally Posted by Vragec
How to read disk info(e.g. size, type, name, partitions, mount point, ... ) in c ?

without df
In C?

Maybe what you are looking for is something like fdisk -l as xcore said. May be you should just run mount to see the mounted filesystems details.
 
Old 05-22-2006, 02:48 AM   #4
Vragec
LQ Newbie
 
Registered: May 2006
Posts: 2

Original Poster
Rep: Reputation: 0
I have to use partitions tables to see witch partitions are on disk. So i can't use fdisk -l.
 
Old 05-22-2006, 02:59 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,063

Rep: Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918
Sounds like a homework question - see the forum rules.
 
Old 05-22-2006, 04:04 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Quote:
Originally Posted by Vragec
I have to use partitions tables to see witch partitions are on disk. So i can't use fdisk -l.
fdisk -l gives all partitions on all disks
 
Old 05-22-2006, 07:03 AM   #7
xcore_on
Member
 
Registered: Mar 2006
Posts: 96

Rep: Reputation: 15
The simple command: "fdisk -l" show all disk and partition informations for all disk available on you system, partitioned/formated or not (if RH or Fedora Core 5, where I was tested).

But it's not very true for debian 3.1.r1 (kernel 2.4.27-386). you must use: "fdisk -l /dev/hda1" for example to obtain informations.

Maybe this is because of version of the fdisk.
 
  


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
How to get info about an scsi disk? noware Linux - Software 3 05-12-2006 03:05 AM
Disk usage info in C/C++ Ephracis Programming 7 03-14-2006 04:30 AM
Memory/Disk Info cherukuri_sr Linux - General 3 04-08-2005 11:11 AM
need info on creating a boot disk Hockeyfan Fedora 1 03-05-2005 07:01 PM
where is info on free disk space stored (/proc?) eigenyeugen Linux - General 3 01-30-2005 10:45 AM


All times are GMT -5. The time now is 01:22 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