LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 04: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 05:01 AM.
 
Old 05-18-2006, 05:29 AM   #2
xcore_on
Member
 
Registered: Mar 2006
Posts: 96

Rep: Reputation: 16
maybe fdisk -l work for you
 
Old 05-21-2006, 04: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, 01: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, 01:59 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,120

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Sounds like a homework question - see the forum rules.
 
Old 05-22-2006, 03:04 AM   #6
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

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, 06:03 AM   #7
xcore_on
Member
 
Registered: Mar 2006
Posts: 96

Rep: Reputation: 16
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:03 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
Open Source Consulting | Domain Registration