- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- shell script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 03:20 AM
08-01-2003 03:20 AM
How can you detect/check which drive (dev/hda or /dev/hdc) is up using a script?
I'm making an offline disk mirroring script using dd command. Offline disk mirroring in the sense that the mirroring is a scheduled type of backup (not like the usual one which is a realtime mirroring - to avoid crashes when certain patch is applied and it can boot either of the drives at once).
Hope you can help me.
Regards
LAT
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 03:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 05:53 AM
08-01-2003 05:53 AM
Re: shell script
thanks for the help! Just want to make a correction on the declaration of the variable it should be
ACTIVEA=$(df|grep /dev/hda|wc -l)
ACTIVEC=$(df|grep /dev/hdc|wc -l)
instead of
ACTIVEA='df|grep /dev/hda|wc -l' -- this will have a string result.
Regards,
LAT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 09:05 AM
08-01-2003 09:05 AM
Re: shell script
Lets say that this depend on the shell
that script is for (sh/bash/csh/ksh)
And yes you can do this.
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 09:07 AM
08-01-2003 09:07 AM
Re: shell script
If you don't want a sting value, your correction is right. Good correction.
On the other hand FYI, you can obtain useful information about the system in the virtual /proc file system. For example, if you issue:
cat /proc/modules, you get information about loaded kernel modules. Or
cat /proc/meminfo, you get information about the used memory in the system.
Or about the partitions you have "used" you can type: cat /proc/partitions and pipe the output through a grep like in df command.
Regards.
Frank.