[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: lokking for portable way to determine the size of harddisks



On Wed, Mar 07, 2001 at 08:38:54PM +0100, Thomas Lange wrote:
> I want to determine the size of the local harddisks in a shell. It
> must be portable so it runs on all hardware. First is used sfdisk,
> but it's only available on i386. Now I'm using /proc/partitions on a
> 2.2 kernel:

malcolm@arthur:~$ cat /proc/ide/hda/capacity 
35606592

malcolm@arthur:~$ dc
35606592 512 * p
18230575104
2 k
1024 / 1024 / 1024 / p
16.98

17Gb

not sure about scsi.



Reply to: