Monthly Archives: November 2009

NTBACKUP error – “End of Media encountered while backing up to non-removable media.”

Today I was investigating why some ntbackup jobs were failing on a remote server, and came across this error message in the logs : “End of Media encountered while backup up to non-removable media”. So I googled the error, and came up with a couple forums talking about how backups being saved to tape drives get this error when the tape runs out of space.  In my situation however, I was not using a tape drive for the backups, I was using an external hard drive.

Below is a screenshot of the NTBACKUP log

NTBACKUP log error

As you can see in the NTBACKUP log, when it tried to backup the files to the external hard drive it encountered the “End of Media” error.

So at this point I was hitting my head against the wall wondering why in the *(#$ is this happening!!?  The external hard drive had plenty of free space for the backups, it just didn’t make any sense!!  As a usual Sysadmin response I decided to dig dipper into the issue.  After thinking it though a bit, I had some inspiration to check “Computer Management” and take a look at the partition and filesystem setup of the external hard drive.  Below is a screenshot of what I discovered in Computer Management:

computer management - bestsrv

If you look volume E: in the top right, under filesystem it reads “fat32″! Once I saw that it occurred to me that the backups were failing because they exceeded the 4GB file size limit of the fat32 filesystem.  Sure enough after checking the backup sizes It was just barely over 4GB which would explain why NTBACKUP reported that the disk was out of space.  After discovering the true cause behind the failing backups, I backed-up all the data on the Western Digital MyBook, reformatted it with NTFS, and transferred all the data back onto the external drive.  That effectively solved the issue and allowed the customer to continue to backup the server without buying any additional hardware.

It just comes to show that most problems are simple to fix and easy to overlook.

References:

http://www.experts-exchange.com/Storage/Misc/Q_20710438.html

http://en.wikipedia.org/wiki/File_Allocation_Table

  • Share/Bookmark

How to prevent yourself from accidentally deleting files in Unix/Linux

Everyone at some point has faced that horrible moment when you realize that you just deleted a critical file, and start scrambling to find ways to recover it before it is too late.  If you haven’t faced this situation yet, you are the lucky few who have been spared from this horrible experience so far.  Just the other day, I found a really creative solution in Linux that will prevent you from accidentally deleting files by mistake.  It’s actually not that complicated either, and I am sure you will be using this technique to protect your most valuable files after your through reading my how-to.

Step 1 – Choose a Directory

HOWTO-prevent-accidental-delete

As you can see, I have created a directory called “test” and have created a ton of empty files and directories for testing purposes.  It was fun writing the Perl script to create all those “crap” files.

Step 2 – Create a empty file call “-i” in the chosen directory

HOWTO-prevent-accidental-delete-2

To do this simply use the touch command to create the empty file “-i”, as such: “touch ./-i”

Step 3 – Verify that “-i” exists in the current directory

HOWTO-prevent-accidental-delete-3.1

To make sure “-i” was created successfully, list the directory contents by invoking the “ls” command as show above.  Once you do that you will notice a new file called “-i” listed in the current directory.

Step 4 – Try to delete the files in the current directory

HOWTO-prevent-accidental-delete-3.9

Try deleting all of them at once by using “rm *”.

WARNING – make sure you have the “-i” the the directory before you try to remove any files!  Without the “-i” file there will be nothing to stop the rm command from removing your precious files!!

Below is a screenshot of what should happen when you try to delete any file in that directory.

HOWTO-prevent-accidental-delete-4

Did you notice what happened?  When we tried to delete any file in that directory, It would prompt us to confirm if we really wanted to delete each file.  This happens because the “-i” file is immediately interpreted by the Unix/Linux command line as a option for the “rm” command, which prompts before deleting a file.  If you man rm and look through the man page you will find the following entry:

  -i, --interactive
	      prompt before any removal

So that is the magic behind creating the empty “-i” file and how it helps prevent you from deleting file by mistake. Now don’t forget that if you use the rm -f command, it will delete the file no matter what!! That’s why it’s called the FORCE option!

Use this technique to your advantage and spread the word!

  • Share/Bookmark