<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.coria-cfd.fr/index.php?action=history&amp;feed=atom&amp;title=Quotas_on_irene</id>
		<title>Quotas on irene - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.coria-cfd.fr/index.php?action=history&amp;feed=atom&amp;title=Quotas_on_irene"/>
		<link rel="alternate" type="text/html" href="https://www.coria-cfd.fr/index.php?title=Quotas_on_irene&amp;action=history"/>
		<updated>2026-05-21T19:17:45Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://www.coria-cfd.fr/index.php?title=Quotas_on_irene&amp;diff=3811&amp;oldid=prev</id>
		<title>Lartigue: Created page with &quot;== What's the problem? ==  Sometimes, on Irene Joliot-Curie (the last TGCC supercomputer), you will be confronted to the following error:  '''''error writing ‘XXXX’: Disk...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.coria-cfd.fr/index.php?title=Quotas_on_irene&amp;diff=3811&amp;oldid=prev"/>
				<updated>2018-12-05T09:37:52Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;== What&amp;#039;s the problem? ==  Sometimes, on Irene Joliot-Curie (the last TGCC supercomputer), you will be confronted to the following error:  &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;error writing ‘XXXX’: Disk...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== What's the problem? ==&lt;br /&gt;
&lt;br /&gt;
Sometimes, on Irene Joliot-Curie (the last TGCC supercomputer), you will be confronted to the following error:&lt;br /&gt;
&lt;br /&gt;
'''''error writing ‘XXXX’: Disk quota exceeded'''''&lt;br /&gt;
&lt;br /&gt;
This problem is actually more complex than it seems.&lt;br /&gt;
This goal of this page is to provide the explanation of this issue and how to solve it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Groups ==&lt;br /&gt;
&lt;br /&gt;
On Linux, a user is defined by a number, which is set in /etc/passwd. For exemple, on my machine, I am the user 1001:&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; cat /etc/passwd | grep lartigue''&lt;br /&gt;
&lt;br /&gt;
'''lartigue:x:1001:1001::/home/lartigue:/bin/bash'''&lt;br /&gt;
&lt;br /&gt;
As you can see, the number 1001 is printed two times on this line: the first one corresponds to my 'User ID', the second one corresponds to my 'Group ID': these numbers are not necessarily identical.&lt;br /&gt;
This means that each user is associated to a group, known as its 'principal group'.&lt;br /&gt;
&lt;br /&gt;
However, a user can be associated to many other groups (which are known as ‘secondary groups’).&lt;br /&gt;
For exemple, on irene, my groups are:&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; groups''&lt;br /&gt;
&lt;br /&gt;
'''coria avbp ra0381 gen6880 gch0011 ra1113 intelmpi gen7345 gen10161 ra3999 gch0305 cont005'''&lt;br /&gt;
&lt;br /&gt;
The first group that appears on this line is my principal group, the others are my secondary groups.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Creating files/directories ==&lt;br /&gt;
&lt;br /&gt;
On Linux, each file on the filesystem possesses some metadata: its size, its creation date, to which user and to which group it belongs and what are the associated permissions.&lt;br /&gt;
When a user creates a file (via cp/scp/touch/rsync/vi/...) this file is automatically associated to this user and to its principal group.&lt;br /&gt;
&lt;br /&gt;
For example when I create a file on irene:&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; touch /tmp/toto''&lt;br /&gt;
&lt;br /&gt;
'' &amp;gt; ls -l /tmp/toto''&lt;br /&gt;
&lt;br /&gt;
'''-rw-r-----. 1 lartigug coria 0 Nov  5 08:38 /tmp/toto'''&lt;br /&gt;
&lt;br /&gt;
This file is empty (size=0), it has been created on Nov. 5th at 8:38AM and is associated to me (user=lartigug) and to my principal group (group=coria). &lt;br /&gt;
&lt;br /&gt;
Moreover, as my umask is set to 0027, its permissions are set to '''-rw-r-----'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The real Issue ==&lt;br /&gt;
&lt;br /&gt;
It is actually quite simple to understand: on every production machine, there are some quota associated to users and groups.&lt;br /&gt;
This means that the amount of data that belongs to you or to one of your group can not go beyond a certain limit.&lt;br /&gt;
&lt;br /&gt;
Now, if you transfer a lot of files (scp/rsync) or if you create a lot of file (during a simulation), all these files will belong to your principal group. And if there is a quota on this group, you will get the nasty error '''''error writing ‘XXXX’: Disk quota exceeded'''''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to solve this issue ==&lt;br /&gt;
&lt;br /&gt;
Well, the idea is quite simple: you must create the files with a different group for which the quota is not exceeded…&lt;br /&gt;
&lt;br /&gt;
For example on irene, the quota on group gen6880 is much larger than on the group coria.&lt;br /&gt;
&lt;br /&gt;
But HOW?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Technical solution #1 ==&lt;br /&gt;
&lt;br /&gt;
If the files are already there but you want to change their group, just use the classical ''chgrp [-R]'' command (with -R to go recursive).&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; mkdir /tmp/dir_test''&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; ls -la /tmp/dir_test''&lt;br /&gt;
&lt;br /&gt;
'''drwxr-x---.  2 lartigug coria     6 Nov  5 08:58 .'''&lt;br /&gt;
&lt;br /&gt;
''chgrp gen6880 /tmp/dir_test''&lt;br /&gt;
&lt;br /&gt;
'''drwxr-x---.  2 lartigug gen6880     6 Nov  5 08:58 .'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Technical solution #2 ==&lt;br /&gt;
&lt;br /&gt;
You can change the default behaviour of directories so that new files are created with different ownership.&lt;br /&gt;
&lt;br /&gt;
If I create a file in the previous directory /tmp/dir_test (group=gen6880), this file is created with the classical ownership lartigug:coria&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; touch /tmp/dir_test/file1''&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; ls -l /tmp/dir_test/file1''&lt;br /&gt;
&lt;br /&gt;
'''-rw-r-----. 1 lartigug coria 0 Nov  5 09:04 /tmp/dir_test/file1'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now let me ''setgid'' the directory /tmp/dir_test. This is achieved with the following command:&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; chmod g+s /tmp/dir_test''&lt;br /&gt;
&lt;br /&gt;
Now check what happend:&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; ls -la /tmp/dir_test''&lt;br /&gt;
&lt;br /&gt;
'''drwxr-s---.  2 lartigug gen6880    32 Nov  5 09:05 .'''&lt;br /&gt;
&lt;br /&gt;
The ''s'' indicates that the directory is now setgid.&lt;br /&gt;
This means that each new file/directory will be created with ownership lartigug:gen6880&lt;br /&gt;
&lt;br /&gt;
Let’s check this:&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; touch /tmp/dir_test/file2''&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; ls -l /tmp/dir_test/file2''&lt;br /&gt;
&lt;br /&gt;
'''-rw-r-----.  1 lartigug gen6880     0 Nov  5 09:05 file2'''&lt;br /&gt;
&lt;br /&gt;
Moreover when creating a new sub-directory, it will keep its setgid property!&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; mkdir subdir''&lt;br /&gt;
&lt;br /&gt;
''&amp;gt; ls -l''&lt;br /&gt;
&lt;br /&gt;
'''drwxr-s---. 2 lartigug gen6880     6 Nov  5 09:15 subdir'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Technical solution #3 ==&lt;br /&gt;
&lt;br /&gt;
Some difficulties may arise when you transfer files from your computer to irene.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Use tar &amp;amp; scp ===&lt;br /&gt;
&lt;br /&gt;
first tar you directories&lt;br /&gt;
transfer the tar&lt;br /&gt;
untar&lt;br /&gt;
&lt;br /&gt;
This will keep the right ownership and setgid property in all your directories/subdirectories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Use rsync with options ===&lt;br /&gt;
&lt;br /&gt;
Use rsync but add the following options to modify its default behaviour:&lt;br /&gt;
&lt;br /&gt;
rsync --chmod=g+s --chown=:gen6880 …….&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Use scp -r ===&lt;br /&gt;
&lt;br /&gt;
If you do so, you '''MUST''' then do a ''chmod -R g+s'' on your directory because the setgid will not propagate in the subdirectories.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
http://www.linuxaddict.fr/index.php/2018/06/04/les-droits-speciaux-sous-gnu-linux-setuid-setgid-sticky-bit-et-umask/&lt;br /&gt;
&lt;br /&gt;
https://tech.feub.net/2008/03/setuid-setgid-et-sticky-bit/#&lt;/div&gt;</summary>
		<author><name>Lartigue</name></author>	</entry>

	</feed>