LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-02-2006, 03:33 PM   #1
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Rep: Reputation: 85
Exclamation viewing the size of a drive that has no partitions


How can I see the size of a hard drive if it doesn't have any partitions yet? Linux fdisk did not tell me.
 
Old 09-02-2006, 03:39 PM   #2
e5150
Member
 
Registered: Oct 2005
Location: Sweden
Distribution: Slackware and Alpine
Posts: 123

Rep: Reputation: 91
Code:
cfdisk /dev/hdX
...should tell you the size of the free space, which would be the total capacity of the hard drive, if there is no partitions on it.
 
Old 09-02-2006, 03:40 PM   #3
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Quote:
Linux fdisk did not tell me.
Sure it does ....
Code:
fdisk -s /dev/hda
 
Old 09-02-2006, 07:40 PM   #4
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495

Original Poster
Rep: Reputation: 85
Code:
ubuntu@ubuntu:~/Desktop$ sudo fdisk -s /dev/sda
312571224
ubuntu@ubuntu:~/Desktop$
From the man pages, I get this information. Size is shown in blocks, not bytes, so how can I convert this to a human readable format such as gigabytes?

Code:
       fdisk -s PARTITION           Give partition size(s) in blocks
 
Old 09-02-2006, 07:53 PM   #5
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 335Reputation: 335Reputation: 335Reputation: 335
Here is the output of /sbin/fdisk -l.

Code:
user> /sbin/fdisk -l

Disk /dev/hda: 81.9 GB, 81964302336 bytes
16 heads, 63 sectors/track, 158816 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1       18725     9437368+  83  Linux
/dev/hda2           18726       20806     1048824   82  Linux swap / Solaris
/dev/hda3           20807      158816    69557040   83  Linux

Disk /dev/hdb: 81.9 GB, 81964302336 bytes
16 heads, 63 sectors/track, 158816 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdb1   *           1       24975    12586896   83  Linux
/dev/hdb2           24975       27046     1044225   82  Linux swap / Solaris
/dev/hdb3           27047      158816    66412080   83  Linux

Disk /dev/hdd: 61.4 GB, 61492838400 bytes
16 heads, 63 sectors/track, 119150 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hdd1   *           1      119150    60051568+  83  Linux

Disk /dev/sda: 300.0 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        5099    40957686    7  HPFS/NTFS
/dev/sda2            5100       36483   252091980   83  Linux
Or you could look at the hard drive. They all state their capacity on the outside where the brand and model number are located.

Last edited by stress_junkie; 09-02-2006 at 07:54 PM.
 
  


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
problem viewing multiple FC4 partitions from other distros (and Windows) thanto_ Fedora 5 02-14-2006 09:11 PM
Viewing Windows partitions in Redhat 8 lucid Linux - Distributions 5 06-07-2005 11:16 PM
viewing windows partitions mkkreddy Linux - Newbie 6 03-21-2005 12:09 AM
viewing linux partitions from a windows install? bigjohn General 9 09-30-2004 08:06 PM
viewing partitions and drives gag Linux - Newbie 4 11-09-2003 11:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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