Thursday, November 3, 2011

error: 452 Error writing:file larger than ulimit set

error: 452 Error writing file: A file cannot be larger than the value set by ulimit

Once I wanted to transfer file from a MAC machine to AIX 64 bit machine. It was an archived file. But after a few seconds of transfer, an abrupt notification of File size exceed was observed. It took me a while, but when the cause was found, I smiled. It was due to a basic setting in Unix based OSes.
The error seen was “Error Writing File : A file cannot be larger than the value set by ulimit”

So here comes the trick of Changing the maximum allowed file size (ulimit)
You cannot create or copy a file that is larger than the limit allowed by ulimit. The profit achieved by this restriction is that it prevents runaway processes from taking up too much disk space.

If you have to work with a file that exceeds the set limit, you must change the default user limit size.
It may be important to note at this point of discussion that the ulimit cannot exceed the values of the SFSZLIM and HFSZLIM tunable parameters.

In addition, do also note that the changed user limit is in effect for the current session only.
1. Use the su command to become root.
2. To view your current limit in blocks, enter:
ulimit -a
3. To set your limit to the new size for the current session, enter:
ulimit [-f] new_size< You can also permanently change your file size limit by setting the new limit in the /etc/profile or the /etc/default/login file. error: 452 Error writing file: A file cannot be larger than the value set by ulimit When trying to transfer a very big file (over ftp for example), you'll receive the error above, this limit is a security limit in AIX and you can solve it by simply editing the /etc/security/limits file and increasing the "fsize" limit or simply changing it to "-1" to be unlimited, and then retry your transfer, you don't have to restart the machine for changes to take effect. This problem have occurred to many as seen over the Internet. Many have reported to see this problem for the first time when they were trying to copy Oracle installer (of size : 1238844 KB) from Windows box to AIX 5.2 box through ftp and it throwed the following The error as already pointed was --" 452 Error writing file: A file cannot be larger than the value >set by ulimit."

Many have reported that they changed the ulimit value to unlimited and then tried copying even after
that the same error was thrown.
Then they changed fsize value in /etc/security/limits file.
Then I tried copying the Oracle installer and it was successful.

It should be remembered here that the problem here is the file system on AIX is JFS (Journalled File
System) and it supports files of size <=2GB. So, if we want to have a file
of size more than 2 GB we need to change the file system to Extended
Journalled File System.

Wish yo all the best,
Anwar

Introduction to Linux FTP command by Anwar Faiz

This post is an introduction to the Linux FTP command. I will discuss in short, the FTP commands, ‘l-variants’, ‘!-variants’, and ‘m-variants’ command in FTP.

To start with, let me tell you that ftp command relates to the File Transfer Protocol. A typical use of the command ftp is for remotely copying, renaming, and deleting files.

For instance:
ftp abc.anwar.edu
This command will attempt to connect to the ftp server at abc.anwar.edu. If it succeeds, it will ask you to log in using a username and password. In case it is a public ftp server, it often allows you to log in using the username "anonymous" and your email address as password. After you are logged in you can get a list of the available ftp commands using the simple help function:
ftp> help
This lists the commands that you can use to show the directory contents, transfer files, and delete files.

Now let us analyze what you can do once you are in FTP command mode. The Shell prompt at this time typically becomes as ftp>.
You can type one of many commands available now to achieve different results.
For instance, ftp> ls
This command prints the names of the files and subdirectories in the current directory on the remote computer.
In a similar way, ftp> cd customers
This command changes the current directory to the subdirecotry "customers", if it exists.
In the same manner, ftp> cd ..
Changes the current directory to the parent direcotry.
Now there can be another variants of these commands too. Because remember now you are in a 2 computer zone. One is your host system from which the ftp command is run. Another is your remote system that has been FTPed here. So for these you can use a prefix ‘l’ befor above command to traverse through the directory structure of the local computer. Obviously ;) local means host system.
For example, ftp> lcd images.
Changes the current directory on the local computer to "images", if it exists.

Now we can directly land into serious discussions. First of any such discussion is about the modes of transfer. There can be two modes of transfer of files. One is ‘ascii’ and another is ‘binary’.
For example, ftp> ascii
Changes to "ascii" mode for transferring text files.
And ftp> binary
Changes to "binary" mode for transferring all files that are not text files.

The next point in discussion is about the transfer of files. After all, it is only for which the FTP command is all about.
So here comes the first one GET command.
Using ftp> get image1.jpg
You can download the file image1.jpg from the remote computer to the local computer.
It is warned that in case there already is a file with the same name it will be overwritten. Obviously you may smile over this warning ;)

And now comes the command for Uploading data, the PUT command
The command ftp> put image2.jpg
Uploads the file image2.jpg from the local computer to the remote computer. Again the same warning of file overwriting if file exists.

Using ‘!’-variant commands in ftp you can achieve results on local computer.
ftp> !ls
A '!' in front will execute the specified command on the local computer. So '!ls' lists the file names and directory names of the current directory on the local computer.

The last of such serious ( please smile again ;) what serious?). Ok. So the last one of such serious discussions would be the ‘m’-variant commands of get and put.
ftp> mget *.jpg
With mget you can download multiple images. This command downloads all files that end with ".jgp".
ftp> mput *.jpg
Uploads all files that end with ".jgp".
ftp> mdelete *.jpg
Deletes all files that end with ".jgp".

The blogpost would remain incomplete if I do not tell about the last point.
ftp> quit
This command exits the ftp program, and lets you return on the normal shell prompt.

With this I end this blogpost. I guess, it is sufficient to begin with and in a typical day to day job. For more details and examples, you may like to visit the website FTP tutorial from About.com. Take care :)