Tag Info

Hot answers tagged

22

You can use false (/bin/false, /usr/bin/false, or shell builtin): $ false || echo It failed. It failed. $ You can also use exit 1 from a subshell: $ (exit 1) || echo Gosh, it failed too. Gosh, it failed too. $


9

Petr Uzel is spot on but you can also play with the magic $?. $? holds the exit code from the last command executed, and if you use this you can write your scripts quite flexible. This questions touches this topic a little bit, Best practice to use $? in bash? . cmd1 if [ "$?" -eq "0" ] then echo "ok" else echo "Fail" fi Then you also can react to ...


8

Unmount the drive and run badblocks -n on it. This will rewrite every sector on the drive — read-then-write, so it's nondestructive — which forces the drive to swap in a fresh sector for every dodgy one found during the pass. If badblocks can't fix it, you could step up to SpinRite which does that and more. If either of those "fixes" the drive ...


7

Hardware failures always run some risk of crashing the Kernel since those code paths generally have had much less testing, but normally, a failed hard drive should not crash the Kernel. What exactly happens depends on the nature of the failure. Perhaps only certain sectors are now unreadable rendering parts of the /home partition unreadable, the system ...


7

I have noticed for some reason (and whether this is true or not, I'm not sure) that Linux is more sensitive to failing hardware. I have seen this on my home office computer a couple of times. Your best bet is to start running hardware diagnostics. For that I would recommend Ultimate Boot CD. In your case, I would start with running a Memtest (at least ...


7

Bad sectors are always an indication of a failing HDD, in fact the moment you see an I/O error such as this, you probably already lost/corrupted some data. Make a backup if you haven't one already, run a self test smartctl -t long /dev/disk and check SMART data smartctl -a /dev/disk. Get a replacement if you can. Bad sectors can't be repaired, only replaced ...


6

I hate to be the bearer of bad news, but... Q: I'm new to mdadm, did I do everything correctly? A: No. In fact, you did just about everything in the most destructive way possible. You used --create to destroy the array metadata, instead of using --assemble which probably would have allowed you to read the data (at least, to the extent the disk is ...


5

The worst and most likely case is that you will lose everything. If you have a single logical volume spanning both drives, and you lose one drive with no mirroring, you've essentially wiped out half the file system. From this point, it gets mildly better depending on what file system you are running on your volume. Assuming that you are not using ...


4

When a package fails to configure, you can install the missing dependencies after the fact using apt-get install -f. Here is the description of -f from the documentation: -f, --fix-broken Fix; attempt to correct a system with broken dependencies in place. This option, when used with install/remove, can omit any packages to permit APT to ...


4

A very secure way would be - if your find supports -delete - to use find for deleting: find -type d -name 27-Jan -empty -delete Since -delete implies -depth, it will first walk down the tree to directory 3275, delete it, step up one step, now 3274 is empty too, and can be deleted, step up to 3273 and so on... man find: -depth Process each ...


3

No, bad sectors are not always an indication of a failing drive. Sometimes if a write is in progress at the time of a power failure, the data in the sector will be corrupted, resulting in an error when you try to read it. Attempting to write new data to the sector may work just fine since there's nothing physically wrong with it. You can run badblocks -n ...


2

You can remove directory hierarchies recursively using -r switch of rm -r, -R, --recursive remove directories and their contents recursively So issuing rm -r 27-Jan should get rid of the directory. Unless you have already tried that, of course. In that case, could you specify the error you get?


2

Such rarely occurring crashes are very hard to debug. It can be a hardware problem, driver (flgrx, as you've noticed) issue or even a kernel bug. The easiest thing to do in your case is to change the video driver - of course that will only prevent further crashes only in case the driver was the problem source. Unfortunatelly, the right direction to go is ...


2

dependancies are packages your package needs to run ( for example libraries etc ). If you install a package trough aptitude / apt / synaptic this will check for the dependancies and download them. If you download a .deb file and try to install it manually this might not be the case. As posted before you need to install the required packages before ...


2

Anacron is great for what it is... a system to ensure jobs are executed every N number of days, after rebooting--not much control there. Furthermore, it's not a resident daemon and therefore can't replace crond or atd; it starts up at boot time (or when manually invoked), waits for the appropriate intervals before checking some conditions, and then once ...


2

First off, 72 hard drives is a lot (biggest machine I have is only 24... and has 1200W supplies) I hope you're using staggered spinup. You're probably seeing the drives start an offline data collection. That would explain the increase in power usage. It also means that if you were to actually use the drives, you'd probably push the power consumption at ...


2

More closely monitoring the system it's power consumption using a "watts up?" Watt meter lead to a stronger belief that these restarts were caused by an over current protection (OCP) on the power supply that kicks in. Asking why the power consumption increase was happing 15 minutes after boot, lead to a serverfault answer that 15 minutes after boot all 74 ...


2

Some possibilities: As Alan suggested, bad memory is a common cause of problems. bad power-supplies can also cause random freezes and crashes. low-quality motherboard. either due to shoddy manufacturing or due to bad/dodgy parts (e.g. a sub-standard or cheap version of a NIC that claims to be a particular brand/model but isn't - the manufacturer's Windows ...


1

I've always used Unetbootin to do these types of installations. It's a standalone executable so there isn't anything to install, simply download it and run.                        


1

As per your output of last -x , seems reboot every 17-18 minute, so you first need to check, is there any script or cron is set for reboot or not? If not then read below. Hardware related error you can check in dmesg | tail or software related logs your can find in logs of that particular application which you are running in your server usually tail -f ...


1

I suspect what is happening is that hibernation is on by default. Hibernation expects the disk to be in exactly the same state during shutdown and startup. Since you boot Windows, the disk gets modified. (I believe this is how it works, but I'm not sure. It does explain your symptoms.) The solution is to ensure that hibernation is not enabled in your Linux ...


1

This may be a situation where the batch option of at could help. From my sandbox RHEL5 machine, I was able to schedule a batch job two minutes into the future, then stop atd. I let five minutes pass, and then started atd again. When atd started, the batch job kicked off immediately. invocation: batch "NOW+2 minutes" or any acceptable at time input. I did ...


1

For jobs that are executed once, at already does exactly what you require. At any time, atd will execute all scheduled jobs that are past their scheduled dates. In particular, at boot time, starting atd triggers the execution of any job whose date became due during the downtime. For periodic jobs, you could combine a fixed-schedule crontab entry and an ...


1

On my PowerEdge 2500, when I first got it, the PERC (hardware RAID) controller's firmware was not at the latest revision. The effect of this is that the root disk would just suddenly disappear and would no longer be accessible (very similar to if it was a removable drive and it was just suddenly disconnected). I couldn't load any new programs, programs ...



Only top voted, non community-wiki answers of a minimum length are eligible