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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
07-28-2014, 07:07 AM
|
#1
|
Member
Registered: Jun 2014
Posts: 37
Rep: 
|
checking filesystem
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"
fi
# end of Test Script
please help me,
thanks and regards,
ganesan
Last edited by ganesan_p; 07-28-2014 at 07:08 AM.
|
|
|
07-28-2014, 08:01 AM
|
#2
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 24,519
|
see man page, or here: http://www.qnx.com/developers/docs/q...g_chkfsys.html
chkfsys will return nonzero in case of problems.
you need to use $ in your test command:
if test $STATUS -ne 0
|
|
|
07-29-2014, 09:12 AM
|
#3
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,794
|
Quote:
Originally Posted by ganesan_p
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
|
...which is VERY similar to your other thread:
http://www.linuxquestions.org/questi...em-4175511911/
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.
|
|
|
07-30-2014, 05:31 AM
|
#4
|
Member
Registered: Jun 2014
Posts: 37
Original Poster
Rep: 
|
hi ,
i have one question,
can mount the corrupted filesystem partition?
regards,
ganesan
|
|
|
07-30-2014, 08:34 AM
|
#5
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,794
|
Quote:
Originally Posted by ganesan_p
hi ,
i have one question,
can mount the corrupted filesystem partition?
|
Since it's CORRUPTED, obviously not. Please see any of your other numerous threads about partitions for more hints to help you get going.
|
|
|
All times are GMT -5. The time now is 06:55 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|