Tag Info

Hot answers tagged

24

These should do what you need: cmd1 && cmd2 && echo success || echo epic fail or if cmd1 && cmd2; then echo success else echo epic fail fi


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. $


10

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 ...


9

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 ...


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

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 ...


6

Try rm -rf to avoid the prompting. -f, --force ignore non-existent files, never prompt


6

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 ...


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 ...


5

I've not used this tunable before but you probably want to adjust the eh_timeout (error handling timeout) for the drive in question: [root@localhost device]# cat /sys/block/sda/device/eh_timeout 10 [root@localhost device]# The above shows sda set to 10 seconds. From Red Hat Knowledgebase: In certain storage configurations (for example, configurations ...


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 ...


3

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

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

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 ...


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

Monitor /sys/block/<dev>/stat for the devices you're interested in and compare the 10th parameter (io_ticks). eg, ticks = io_ticks - prev_ticks / seconds_deltatime / 10 This is the percentage of available time that the disk has spent waiting for disk io. Close to 100% would be worth checking of course, or else get really clever and compare it to the ...


2

Netstat -an , netstat -rn, and lsof (before, and during the problem) may give clues. (Do they show too many open connections?). tcpdump may help too: start it just before establishing the connection and see what happens around the time connections start to die (and also a few minutes before the timeouts). And see if the NFS options are non default and ...


2

Can the disk (ATA) be setup so that a failing read doesn't take too long, so that it can be dropped, and the reading process and the disk wouldn't be blocked, and the next read could be attempted? No. My understanding of this is that it's a logical problem resulting from a design choice (not unique to linux) that favours performance and stability for ...


1

First, do not use fdisk with GPT. Second, since the disk is indeed failing and considering that you have ample free disk space the best thing you can do is clone the entire disk to an image and then work on that image without caring about the disk. You can do this with dd if=/dev/sdc of=image_of_disk.img, assuming that the failing disk is /dev/sdc and it is ...


1

As the issue has been resolved let me add this: It had nothing to do with timidity. It just had some problem with ati driver. When I tried removing fglrx (apt-get remove in recovery mode), it first didn't work, after two attempts it somehow got resolved. Looks like the best drivers are native.


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

I'm having the same problem. I've tried everything in the Mint LMDE thread. The only thing that works is unplugging and replugging in the mouse and keyboard. However no way to do this on the internal laptop ones so it's pretty much dead as a laptop.



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