LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-13-2007, 08:14 AM   #1
Mahonri
Member
 
Registered: May 2007
Location: Austin, Texas, USA
Distribution: Debian Etch
Posts: 34

Rep: Reputation: 15
What is the best way to detect a hard drive in a shell script?


Hello All,

I'm trying to develop my own custom linux kernel installation script and looking for some tips on elegant means to detect hard disk drives, partition them and format them.

I'm sure I could just load the various generic IDE/SCSI driver modules to have the kernel detect the hardware and then do something like "fdisk -l" which I could parse to determine which drives/partitions are there...

Is there a better way to do this?

Thanks in advance,

Dallas Clement
 
Old 06-14-2007, 01:14 AM   #2
opensourcedevelopmen
LQ Newbie
 
Registered: Jun 2007
Location: Delhi
Distribution: Linux
Posts: 21

Rep: Reputation: 16
Oops! I think this is the only solution.
 
  


Reply



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
detect shell script language lorebett Programming 10 09-02-2006 11:15 AM
shell script to detect IDE devices kushalkoolwal Programming 8 09-28-2005 11:15 AM
how to detect hard drive mandrakelinux Linux - Newbie 9 04-28-2005 04:14 AM
Grub won't detect my second hard drive pumpkin7593 Linux - Software 2 04-25-2004 01:30 PM
Script to detect hard disk size rajatgarg Programming 4 11-07-2003 05:46 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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