Hi, Running SuSE 9.0 here. I have had a couple of fsck failures on booting my machine and whilst this is not many, I would like to prevent data loss as much as possible until I can implement a thorough backup solution. I therefore want to test the harddrives for impending failure and also check the filesystem a disk that is OK as without an error free fs the disk is mostly useless as the fs allows data to be written to and stored on the disk. Should an fsck error occur on boot in future I plan to run #e2fsck -pcv -C fd /dev/hd<faulty partition number> as opposed to plain #fsck /dev/hd<faulty partition number> I am aware of the SMARTCTL(courtesy of Carlos), and TUNE2FS programs to complete the above task but do not know how to implement them so that these programs are run at various intervals when the machine is powered on. I have run #smartctl -a on both the hard drives and saw that SMARTCTL was enabled on both. My personal feeling is that TUNE2FS is adequate for my system but I set the fsck parameters a long time ago on all of my partitions with the tune2fsck command and now would like to change the settings. I would like to run a fsck at varying times on the different partitions so that, while the disk might fail, the fs on it would be correct. Looking at the tune2fsck man page I have decided given the advice that, I should stick to the latter of either mount_count or time dependency checking. So I figured I needed the following: #tune2fs -c0 -id<days between checks> /dev/hdd<partition number> This would disable to mount_count checking and run a check on ? no of days on the given device. However no matter how I have tried to amend it to work each time I run the command it just gives me the syntax help(Which really isn't any help). Would someone help please with the syntax and my thought process. Tnx -- ======================================================================== Hylton Conacher - Linux user # 229959 at http://counter.li.org Currently using SuSE 9.0 Professional with KDE 3.1 ========================================================================
Anyone? Hylton Conacher (ZR1HPC) wrote:
Hi,
Running SuSE 9.0 here.
I have had a couple of fsck failures on booting my machine and whilst this is not many, I would like to prevent data loss as much as possible until I can implement a thorough backup solution.
I therefore want to test the harddrives for impending failure and also check the filesystem a disk that is OK as without an error free fs the disk is mostly useless as the fs allows data to be written to and stored on the disk. Should an fsck error occur on boot in future I plan to run #e2fsck -pcv -C fd /dev/hd<faulty partition number> as opposed to plain #fsck /dev/hd<faulty partition number>
I am aware of the SMARTCTL(courtesy of Carlos), and TUNE2FS programs to complete the above task but do not know how to implement them so that these programs are run at various intervals when the machine is powered on. I have run #smartctl -a on both the hard drives and saw that SMARTCTL was enabled on both.
My personal feeling is that TUNE2FS is adequate for my system but I set the fsck parameters a long time ago on all of my partitions with the tune2fsck command and now would like to change the settings.
I would like to run a fsck at varying times on the different partitions so that, while the disk might fail, the fs on it would be correct.
Looking at the tune2fsck man page I have decided given the advice that, I should stick to the latter of either mount_count or time dependency checking.
So I figured I needed the following:
#tune2fs -c0 -id<days between checks> /dev/hdd<partition number>
This would disable to mount_count checking and run a check on ? no of days on the given device. However no matter how I have tried to amend it to work each time I run the command it just gives me the syntax help(Which really isn't any help).
Would someone help please with the syntax and my thought process.
Tnx
-- ======================================================================== Hylton Conacher - Linux user # 229959 at http://counter.li.org Currently using SuSE 9.0 Professional with KDE 3.1 ========================================================================
Hylton Conacher (ZR1HPC) wrote:
Running SuSE 9.0 here.
I have had a couple of fsck failures on booting my machine and whilst this is not many, I would like to prevent data loss as much as possible until I can implement a thorough backup solution. [snip] Would someone help please with the syntax and my thought process.
If you're very concerned about the risks of data loss related to hardware failure, start out by running a journalled filesystem on a redundant/mirrored disk setup. (I use almost exclusively JFS on RAID1). /Per Jessen, Zürich -- http://www.spamchek.com/ - managed anti-spam and anti-virus solution. Let us analyse your spam- and virus-threat - up to 2 months for free.
Hylton Conacher (ZR1HPC) wrote:
Running SuSE 9.0 here.
I have had a couple of fsck failures on booting my machine and whilst this is not many, I would like to prevent data loss as much as possible until I can implement a thorough backup solution.
[snip]
Would someone help please with the syntax and my thought process.
If you're very concerned about the risks of data loss related to hardware failure, start out by running a journalled filesystem on a redundant/mirrored disk setup. (I use almost exclusively JFS on RAID1). Journaled filesystem is installed here (ext3). Additional protection always helps ie you either lose or don't lose data, you are or your not
Per Jessen wrote: pregnant :) Yes, I will sometime in the future lose data, but without a backup solution currently, I'd that that time to be as far as possible in the future. One of my next posts is going to be a start on a backup script built with advice/howtos from the list. -- ======================================================================== Hylton Conacher - Linux user # 229959 at http://counter.li.org Currently using SuSE 9.0 Professional with KDE 3.1 ========================================================================
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Friday 2006-01-06 at 15:33 +0200, Hylton Conacher (ZR1HPC) wrote:
Anyone?
It isn't easy... it is too vague, and the feeling is that you are too "paranoid" ;-)
I have had a couple of fsck failures on booting my machine and whilst this is not many, I would like to prevent data loss as much as possible until I can implement a thorough backup solution.
No, that's not the correct way to look at it. Sooner or later, you will have data loss, no matter what you do: so you must have a backup.
I therefore want to test the harddrives for impending failure and also check the filesystem a disk that is OK as without an error free fs the disk is mostly useless as the fs allows data to be written to and stored on the disk. Should an fsck error occur on boot in future I plan to run # e2fsck -pcv -C fd /dev/hd<faulty partition number> as opposed to # plain # fsck /dev/hd<faulty partition number>
If you want to do such a thing, the place are the scripts /etc/init.d/boot.rootfsck and /etc/init.d/boot.localfs - but those scripts already do analyze the filesystems in case of problems when booting (and after every system crash or power failure); I'd be very careful about modifying them. But this is Linux, not windows: it is very difficult to develop filesystem errors; most are caused by system crashes or power failures. The system will not corrupt your fs while running, even during months.
I am aware of the SMARTCTL(courtesy of Carlos), and TUNE2FS programs to complete the above task but do not know how to implement them so that these programs are run at various intervals when the machine is powered on. I have run #smartctl -a on both the hard drives and saw that SMARTCTL was enabled on both.
My personal feeling is that TUNE2FS is adequate for my system but I set the fsck parameters a long time ago on all of my partitions with the tune2fsck command and now would like to change the settings.
With tunefs you can adjust how often is fsck run on each partition at boot up. Smartctl does a very different check, it doesn't know anything about the filesystem.
I would like to run a fsck at varying times on the different partitions so that, while the disk might fail, the fs on it would be correct.
That would be of very little use. If the disk fails, a) you will probably not be able to read it. b) the fs would probably get corrupted in the process of failing.
Looking at the tune2fsck man page I have decided given the advice that, I should stick to the latter of either mount_count or time dependency checking.
So I figured I needed the following:
#tune2fs -c0 -id<days between checks> /dev/hdd<partition number>
This would disable to mount_count checking and run a check on ? no of days on the given device. However no matter how I have tried to amend it to work each time I run the command it just gives me the syntax help(Which really isn't any help).
Why on earth do you want to disable either mount count or time dependency count? Why not both? The settings that SuSE does by default are very sensible, I would not alter them so much. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFDwur6tTMYHG2NR9URAmt3AJ9U4n3dQjG80edU2dITI41qIEeSowCfY27g 0YlHiF8KinHf5Gj1Xziw9KA= =kVjh -----END PGP SIGNATURE-----
Carlos E. R. wrote:
The Friday 2006-01-06 at 15:33 +0200, Hylton Conacher (ZR1HPC) wrote:
Anyone?
It isn't easy... it is too vague, and the feeling is that you are too "paranoid" ;-)
As I said to Per Jessen. I know I am going to lose data however I would like the time until it happens to be as far away as possible ie until I get a reliable backup solution implemented.
I have had a couple of fsck failures on booting my machine and whilst this is not many, I would like to prevent data loss as much as possible until I can implement a thorough backup solution.
No, that's not the correct way to look at it. Sooner or later, you will have data loss, no matter what you do: so you must have a backup. OK. One of the next emails thru to the list will be the startup of a backup script that I will use as opposed to fiddling around with fscks.
One last thing when the fs fails after a power outage, should I just run #fsck /dev/<bad partition> , or should I run an argument under fsck, besides a/p as warned against ie #fsck > /dev/<bad partition>? I assume the plain fsck would be OK as it will know about the journal etc but maybe '-c' to check for blocks? To the drawing board I go to design the backup script. <anip>
But this is Linux, not windows: it is very difficult to develop filesystem errors; most are caused by system crashes or power failures. The system will not corrupt your fs while running, even during months. Windows it is not but I would like to protect my fs as much as possible during power outages as I cannot get a UPS, yet.
I would like to run a fsck at varying times on the different partitions so that, while the disk might fail, the fs on it would be correct.
That would be of very little use. If the disk fails, a) you will probably not be able to read it. b) the fs would probably get corrupted in the process of failing. In hindsight after looking at my message I agree.
<snip>
So I figured I needed the following:
#tune2fs -c0 -id<days between checks> /dev/hdd<partition number>
This would disable to mount_count checking and run a check on ? no of days on the given device. However no matter how I have tried to amend it to work each time I run the command it just gives me the syntax help(Which really isn't any help).
Why on earth do you want to disable either mount count or time dependency count? Why not both? The settings that SuSE does by default are very sensible, I would not alter them so much. Ah, but I have altered them a while back with the tune2fs command and now want to 'undo' those changes by redoing them.
Currently /root and /home are checked every two days, /usr = x days, /opt is checked every y days etc. Which /etc or other location/file holds a list of the settings I set on the fs that I could print? -- ======================================================================== Hylton Conacher - Linux user # 229959 at http://counter.li.org Currently using SuSE 9.0 Professional with KDE 3.1 ========================================================================
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Thursday 2006-01-12 at 15:30 +0200, Hylton Conacher (ZR1HPC) wrote:
One last thing when the fs fails after a power outage, should I just run #fsck /dev/<bad partition> , or should I run an argument under fsck, besides a/p as warned against ie #fsck > /dev/<bad partition>?
I assume the plain fsck would be OK as it will know about the journal etc but maybe '-c' to check for blocks?
When there is a power failure you need to do nothing, because the init scripts are designed in such a way that they know that the system was not properly closed, and will run fsck on all disks and partitions with the appropiate options, and will solve most problems automatically. If it is not possible to solve it automatically, then the script will pop up into "manual mode", where you are suppossed to investigate and solve the problem manually. "dumpe2fs -h /dev/hdd6" says (root partition, ext3): Filesystem created: Fri Oct 7 01:07:20 2005 Last mount time: Tue Jan 10 16:21:09 2006 Last write time: Tue Jan 10 16:21:09 2006 Mount count: 5 Maximum mount count: 500 Last checked: Tue Dec 6 12:33:26 2005 Check interval: 5184000 (2 months) Next check after: Sat Feb 4 12:33:26 2006 (for /boot, ext2) [no creation date, but must be around 2001-12] Last mount time: Tue Jan 10 16:22:00 2006 Last write time: Tue Jan 10 16:22:00 2006 Mount count: 1 Maximum mount count: 33 Last checked: Tue Jan 10 16:21:24 2006 Check interval: 15552000 (6 months) Next check after: Sun Jul 9 17:21:24 2006 You see the settings vary tremendously.
Why on earth do you want to disable either mount count or time dependency count? Why not both? The settings that SuSE does by default are very sensible, I would not alter them so much.
Ah, but I have altered them a while back with the tune2fs command and now want to 'undo' those changes by redoing them.
You should have kept a lab book ;-)
Currently /root and /home are checked every two days, /usr = x days, /opt is checked every y days etc.
Which /etc or other location/file holds a list of the settings I set on the fs that I could print?
Nowhere. Those settings are stored somewhere in each partition header. Use "dumpe2fs -h device" to see them. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFDx5sUtTMYHG2NR9URAvK4AKCAntGz2JSq9AzezY5of4TssPP2bgCgirJv 4PnswPBbXtFR/xd/3KmI48g= =9mxn -----END PGP SIGNATURE-----
Carlos E. R. wrote:
The Thursday 2006-01-12 at 15:30 +0200, Hylton Conacher (ZR1HPC) wrote:
One last thing when the fs fails after a power outage.....
When there is a power failure you need to do nothing, because the init scripts are designed in such a way that they know that the system was not properly closed, and will run fsck on all disks and partitions with the appropiate options, and will solve most problems automatically. If it is not possible to solve it automatically, then the script will pop up into "manual mode", where you are suppossed to investigate and solve the problem manually.
Investigate and solve how?
"dumpe2fs -h /dev/hdd6" says (root partition, ext3): Carlos, you are a saint. That is almost exactly the command I have been looking for. I was looking for a file that this info is stored in but looking thru the dumpe2fs man page I see it queries the drive directly. Guess I am just going to have to create a file named dumpe2fs_info with >> ie # dumpe2fs -h /dev >> /home/hylton/tmp/dumpe2fs_info.txt ?
You see the settings vary tremendously. I see they change much more than what I thought.
Why on earth do you want to disable either mount count or time dependency count? Why not both? The settings that SuSE does by default are very sensible, I would not alter them so much.
Ah, but I have altered them a while back with the tune2fs command and now want to 'undo' those changes by redoing them.
You should have kept a lab book ;-) Should is such an ugly word. That is why I starting keeping one a while back of what the current fstab is as well as its fsck options. Unfortunately I cannot go back in time so I can only use the lab book in the future, hopefully never mind you.
Nowhere. Those settings are stored somewhere in each partition header. Use "dumpe2fs -h device" to see them. Tnx, time to dumpe2fs :)
The query about tune2fs will be back, but this time just to get the syntax right when I am changing my system to 'normal' values. -- ======================================================================== Hylton Conacher - Linux user # 229959 at http://counter.li.org Currently using SuSE 9.0 Professional with KDE 3.1 ========================================================================
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 The Sunday 2006-01-15 at 11:48 +0200, Hylton Conacher (ZR1HPC) wrote:
When there is a power failure you need to do nothing, because the init scripts are designed in such a way that they know that the system was not properly closed, and will run fsck on all disks and partitions with the appropiate options, and will solve most problems automatically. If it is not possible to solve it automatically, then the script will pop up into "manual mode", where you are suppossed to investigate and solve the problem manually. Investigate and solve how?
With patience and proper skill :-p Sorry, Spanish joke. I mean, there is no guide... but experience, and the fsck man page, which used to be printed in the SuSE admin book just for these occasions.
"dumpe2fs -h /dev/hdd6" says (root partition, ext3): Carlos, you are a saint. That is almost exactly the command I have been looking for. I was looking for a file that this info is stored in but looking thru the dumpe2fs man page I see it queries the drive directly. Guess I am just going to have to create a file named dumpe2fs_info with > > ie # dumpe2fs -h /dev >> with > > /home/hylton/tmp/dumpe2fs_info.txt ?
Yes, but it is safer to run the command any time you need that info.
You should have kept a lab book ;-) Should is such an ugly word.
O:-)
That is why I starting keeping one a while back of what the current fstab is as well as its fsck options. Unfortunately I cannot go back in time so I can only use the lab book in the future, hopefully never mind you.
X'-) I was taught the use of labbooks while I lived in Canada, I'm a "converted": it was completely new concept for me. I don't think anybody knows what it is here, at my home country; different methods, traditions, etc. So, I started to write in one the changes I did on my computer, so that later I know what I did and why. - -- Cheers, Carlos Robinson -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Made with pgp4pine 1.76 iD8DBQFDyl/MtTMYHG2NR9URAohBAJ9cQtoBW5WyTMobrlLNJ6ngCPeYNACfR5kW leoenOTnCNMQQHV/dKAa+8c= =k0oc -----END PGP SIGNATURE-----
participants (3)
-
Carlos E. R.
-
Hylton Conacher (ZR1HPC)
-
Per Jessen