Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
hi i know the chkfsys utility and know how to check through command line . but i want to check in script .
i have cf having 4 partition . 1st partition having qnx image . after booting i have to check filesystem on other partition . if any error having those partition i have to display the error and shutdown . i don't how to do it. please help me to check filesystem in scipting and take decission .
questions:
1) if error on any partition ,chkfsys utility returns anythink?
2) how to take decissions if errors occur?
3) how i kow this partition is error?.
note:i have partition type- hd0t77,hd0t78,hd0t79,hd0t80
i checked below script but this is also not working . "status:not found" error is comming ,
#!/bin/sh
######
# My Test Script
######
echo Test Chkfsys Output
chkfsys -u /dev/hd0t77 $1
STATUS=$?
if test STATUS -ne 0
then
echo "An error occured while running chkfsys!"
else
echo"error not occured"
hi i know the chkfsys utility and know how to check through command line . but i want to check in script .
i have cf having 4 partition . 1st partition having qnx image . after booting i have to check filesystem on other partition . if any error having those partition i have to display the error and shutdown . i don't how to do it. please help me to check filesystem in scipting and take decission .
questions:
1) if error on any partition ,chkfsys utility returns anythink?
If you know how to use the chkfsys utility, then you should know what it returns...especially since the man page TELLS YOU.
Quote:
2) how to take decissions if errors occur?
This is your script...YOU made the decisions however you'd like. Check the return code, and act on whatever you find.
Quote:
3) how i kow this partition is error?.
You know by CHECKING THE OUTPUT of the command you ran
Quote:
note:i have partition type- hd0t77,hd0t78,hd0t79,hd0t80
i checked below script but this is also not working . "status:not found" error is comming ,
Code:
#!/bin/sh
echo Test Chkfsys Output
chkfsys -u /dev/hd0t77 $1
STATUS=$?
if test STATUS -ne 0
then
echo "An error occured while running chkfsys!"
else
echo"error not occured"
fi
# end of Test Script
You're getting "not found", because you just put "chkfsys" in your script, probably. Try putting the whole path into the script...and again, reading the bash scripting tutorials wouldn't be a bad idea.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.