4

My power got cut off while I had my battery off on my PC so it hard shut down. My question is is there anything I can do to check if the system got damaged or was doing something at the time which causes some part to fail? I got a "drive for /tmp is not yet ready or not preset" error for 1-2 seconds when I booted it but then it booted just fine.

I checked the startup logs but didn't see anything weird

1 Answer 1

2

I don't know what you can do to make sure the system is not damaged.

The biggest potential problem is loss of data in the cache waiting to be written into the hard disk. the files in /tmp are temporary and are deleted when you shut down properly. A hard reboot leaves them behind, and the error you saw probably told you just that. Ubuntu checks the health of the hard disks after X number of proper shutdown / restarts. You may want to do that manually by booting from a LiveUSB/DVD

SHORT STEP-BY-STEP TUTORIAL FOR CHECKING EXT4 HARD DISK FOR ERRORS

STEP 1. Ensure you have access to a Ubuntu LiveDVD/Installation Disk. If not, download a copy using another machine.

STEP 2. Change the BIOS on your machine to allow you to boot from a CD.

STEP 3. Insert the Ubuntu disk into your CD-ROM and reboot your machine. Choose the option to 'Try Ubuntu' -- don't reinstall the system!

STEP 4. Once Ubuntu starts (you will not be required to provide a password) you will be in the main desktop.

STEP 5. Open a teminal by pressing Ctrl+Alt+T

STEP 6. Get a pen and paper to write down the paths to your disk drives. Note that when Ubuntu boots it identifies all the hard disks on the system and creates a directory in the '/dev' folder for each. By default these devices are not mounted. If you see a picture on your desktop of a drive then a disk is mounted. You must unmount all disks that are to be checked before proceeding!

STEP 7. Search for Disk Utility in Dash and open it to see what drives are on your system. Use this to verify the drives are not mounted. Also note the addresses of the disks to be checked... they should look like /dev/sdc or /dev/sda1. Also, ensure the drives are actually ext4 and not some other format. Once you recorded the paths then exit the Disk Utility.

STEP 8. To proceed with the check type sudo fsck.ext4 -cDftvy -C 0 /dev/sda1 in the terminal -- remember to substitute your device address. You can only do one disk at a time. On my machine 1TB of data took 3 hours to complete and the bulk of the time (99.99%) was spent checking for bad blocks. If you want to know what the parameters mean then check out the links at the bottom of this post or type fsck.ext4 in the terminal to see a short list of the common command options. Note that fsck.ext4 appears to be a synonym for e2fsck.

STEP 9. As the fsck command has been passed the (v)erbose option parameter details of the progress and any errors will be listed in the terminal window. If errors are found then you will need to consider your options based on whether the fsck package was able to fix them.

STEP 10. Once finished you can shutdown the machine. Ubuntu ejects the CD tray so you can remove the disk before competing the shutdown.

References:

http://ubuntuforums.org/showthread.php?t=1823509

http://manpages.ubuntu.com/manpages/lucid/man8/fsck.ext2.8.html

http://kernelnewbies.org/Ext4

http://linuxexpresso.wordpress.com/2010/03/31/repair-a-broken-ext4-superblock-in-ubuntu/

Hope this helps

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .