LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 03-24-2011, 07:43 PM   #1
Equinn
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.

Thanks,
Elena Quinn
 
Old 03-24-2011, 08:21 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,758

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

cheers
 
1 members found this post helpful.
Old 03-25-2011, 06:40 AM   #3
NM04
Member
 
Registered: Jan 2011
Location: Bangalore, India
Distribution: Back Track,Fedora,centos
Posts: 159

Rep: Reputation: 13
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.

Regards.
 
  


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


All times are GMT -5. The time now is 05:09 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration