[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [CPROG] access til harddiske og partitiontables



In <sslug@sslug> "Jimmy Selgen Nielsen" <sslug@sslug> writes:

>Jeg har behov for at finde ud af hvor mange diske der findes i maskinen, samt 
>hvilke partitioner der findes på dem. 
>Alt skal skrives i C.

Kig på source-koden til "fdisk" programmet (fra "util-linux" pakken).
"fdisk -l" gør meget af det, som du tilsyneladende prøver på -
eksempelvis på min maskine giver den

 
Disk /dev/sda: 141 heads, 62 sectors, 1020 cylinders
Units = cylinders of 8742 * 512 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1       362   1582271   83  Linux
/dev/sda3           363       392    131130   82  Linux swap
/dev/sda4           393      1020   2744988    5  Extended
/dev/sda5           393       475    362762   83  Linux
/dev/sda6           476       478     13082   83  Linux
/dev/sda7           479      1020   2369051   83  Linux
 
Disk /dev/hda: 255 heads, 63 sectors, 790 cylinders
Units = cylinders of 16065 * 512 bytes
 
   Device Boot    Start       End    Blocks   Id  System
/dev/hda1   *         1       510   4096543+   b  Win95 FAT32
/dev/hda2           511       790   2249100   83  Linux      


-- 
Henrik Storner      | "Crackers thrive on code secrecy. Cockcroaches breed 
<sslug@sslug> |  in the dark. It's time to let the sunlight in."
                    |  
                    |          Eric S. Raymond, re. the Frontpage backdoor


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *