Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 03-24-2011, 06:43 PM   #1
LQ Newbie
Registered: Feb 2008
Location: California
Distribution: Slackware 13.1
Posts: 24

Rep: Reputation: 0
How does one determine a USB hard drive capacity in sectors?

Hi All,

How would one determine the capacity in sectors or LBAs of a USB Hard Drive? If I know the USB device number, like from 'lsusb', is there someplace on the system to get other information about the drive? What I want to do is have a program go out and get this information just for the number of LBAs on the drive itself. Partition info doesn't matter for what I am doing.

Elena Quinn
Old 03-24-2011, 07:21 PM   #2
Senior Member
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650Reputation: 650
I believe /sys/block/sdX/size may be in sectors .. multiplying by sector size seems to give the correct disk space

1 members found this post helpful.
Old 03-25-2011, 05:40 AM   #3
Registered: Jan 2011
Distribution: Back Track,Fedora,centos
Posts: 240

Rep: Reputation: 14
hi equinn,

if you have linux, plug in the USB, and then from the terminal run the command "fdisk -l". I think this should give you the sectors in the USB.



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
Capacity issues of hard drive bzlaskar Linux - Hardware 6 05-18-2010 11:35 PM
Full Capacity of New Hard Drive Isn't Recognized. Why Not? km4hr Linux - Hardware 5 03-13-2009 09:13 AM
windows/linux hard drive capacity Vensan Linux - Hardware 2 01-19-2007 10:39 AM
Hard Drive showing incorrect capacity xer Linux - Hardware 7 12-27-2006 10:03 PM
Hard Drive capacity twantrd Linux - General 2 10-12-2004 02:04 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration