<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2022F%3A_Assignment_3</id>
	<title>Operating Systems 2022F: Assignment 3 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://homeostasis.scs.carleton.ca/wiki/index.php?action=history&amp;feed=atom&amp;title=Operating_Systems_2022F%3A_Assignment_3"/>
	<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;action=history"/>
	<updated>2026-04-05T22:41:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24168&amp;oldid=prev</id>
		<title>Soma at 17:40, 25 November 2022</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24168&amp;oldid=prev"/>
		<updated>2022-11-25T17:40:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:40, 25 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l96&quot;&gt;Line 96:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 96:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;unshare --root=. -f -p --mount-proc&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;unshare --root=. -f -p --mount-proc&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==Solutions==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[https://homeostasis.scs.carleton.ca/~soma/os-2022f/solutions/a3-sol.txt Assignment 3 Solutions]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24146&amp;oldid=prev</id>
		<title>Soma: /* Tasks/Questions */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24146&amp;oldid=prev"/>
		<updated>2022-11-19T02:04:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Tasks/Questions&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:04, 19 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l19&quot;&gt;Line 19:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 19:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] What does line 58 of 3000contain.sh do?  When does it run?  Be sure to explain all of its effects.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] What does line 58 of 3000contain.sh do?  When does it run?  Be sure to explain all of its effects.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] What is the largest file we can create in the confined environment (once initialized by 3000contain.sh)?  What determines this limit?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] What is the largest file we can create in the confined environment (once initialized by 3000contain.sh)?  What determines this limit?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] If you fill up the disk in the host system, how will it change the amount of data that can be stored in the confined environment?  Does this depend on what has been previously stored in the confined environment?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] If you fill up the disk in the host system, how will it change the amount of data that can be stored in the confined environment?  Does this depend on what has been previously stored in the confined environment? &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; (Note you may want to test by creating files by dd&#039;ing from /dev/urandom.)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] Many files in our confined environment refer to the same inode.  What was the original name of this inode?  How do you know?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] Many files in our confined environment refer to the same inode.  What was the original name of this inode?  How do you know?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [1] Copy and make nano work in the new environment.  What files did you have to copy to get it to work?  How did you know to copy them?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [1] Copy and make nano work in the new environment.  What files did you have to copy to get it to work?  How did you know to copy them?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24142&amp;oldid=prev</id>
		<title>Soma: /* Tasks/Questions */</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24142&amp;oldid=prev"/>
		<updated>2022-11-12T02:04:50Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Tasks/Questions&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:04, 12 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l16&quot;&gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] Download and inspect [https://homeostasis.scs.carleton.ca/~soma/os-2022f/code/3000contain.sh 3000contain.sh].  Is there a risk of data loss from running this script?  Specifically, how much of a risk is there from each rm command?  Be specific.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] Download and inspect [https://homeostasis.scs.carleton.ca/~soma/os-2022f/code/3000contain.sh 3000contain.sh].  Is there a risk of data loss from running this script?  Specifically, how much of a risk is there from each rm command?  Be specific.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [1] Run 3000contain.sh.  After 3000contain.sh runs, you&amp;#039;re put in a new shell where / is now the contents of 3000fs, and you can&amp;#039;t see anything that wasn&amp;#039;t in 3000fs.  Exiting the shell gets you back to where you were.  After exiting, how do you get back to the contained environment?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [1] Run 3000contain.sh.  After 3000contain.sh runs, you&amp;#039;re put in a new shell where / is now the contents of 3000fs, and you can&amp;#039;t see anything that wasn&amp;#039;t in 3000fs.  Exiting the shell gets you back to where you were.  After exiting, how do you get back to the contained environment?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] How does the output of ps differ when run inside the contained environment versus outside?  What &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;command &lt;/del&gt;caused this difference?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] How does the output of ps differ when run inside the contained environment versus outside?  What &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;part of 3000contain.sh &lt;/ins&gt;caused this difference?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] What does line 58 of 3000contain.sh do?  When does it run?  Be sure to explain all of its effects.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] What does line 58 of 3000contain.sh do?  When does it run?  Be sure to explain all of its effects.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] What is the largest file we can create in the confined environment (once initialized by 3000contain.sh)?  What determines this limit?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] What is the largest file we can create in the confined environment (once initialized by 3000contain.sh)?  What determines this limit?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24141&amp;oldid=prev</id>
		<title>Soma at 02:03, 12 November 2022</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24141&amp;oldid=prev"/>
		<updated>2022-11-12T02:03:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:03, 12 November 2022&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Please submit the answers to the following questions via Brightspace by November 21, 2022 by 11:59 PM. There are &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;?? &lt;/del&gt;points in &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;?? &lt;/del&gt;questions.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Please submit the answers to the following questions via Brightspace by November 21, 2022 by 11:59 PM. There are &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;20 &lt;/ins&gt;points in &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;11 &lt;/ins&gt;questions.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Submit your answers as a plain text file following [https://homeostasis.scs.carleton.ca/~soma/os-2022f/templates/comp3000-a3-template.txt this template].  Name your answer file &amp;quot;comp3000-assign3-&amp;lt;username&amp;gt;.txt&amp;quot; (where username is your MyCarletonOne username).  &amp;#039;&amp;#039;&amp;#039;Please make sure your submission passes the [https://homeostasis.scs.carleton.ca/~soma/os-2022f/validators/a3-validator.html assignment validator].&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Submit your answers as a plain text file following [https://homeostasis.scs.carleton.ca/~soma/os-2022f/templates/comp3000-a3-template.txt this template].  Name your answer file &amp;quot;comp3000-assign3-&amp;lt;username&amp;gt;.txt&amp;quot; (where username is your MyCarletonOne username).  &amp;#039;&amp;#039;&amp;#039;Please make sure your submission passes the [https://homeostasis.scs.carleton.ca/~soma/os-2022f/validators/a3-validator.html assignment validator].&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l14&quot;&gt;Line 14:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 14:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Make sure you backup any important files in your VM, as you could erase everything.  You&amp;#039;ve been warned!&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Make sure you backup any important files in your VM, as you could erase everything.  You&amp;#039;ve been warned!&amp;#039;&amp;#039;&amp;#039;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] [https://homeostasis.scs.carleton.ca/~soma/os-2022f/code/3000contain.sh 3000contain.sh].  Is there a risk of data loss from running this script?  Specifically, how much of a risk is there from each rm command?  Be specific.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Download and inspect &lt;/ins&gt;[https://homeostasis.scs.carleton.ca/~soma/os-2022f/code/3000contain.sh 3000contain.sh].  Is there a risk of data loss from running this script?  Specifically, how much of a risk is there from each rm command?  Be specific.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [1] Run 3000contain.sh.  After 3000contain.sh runs, you&amp;#039;re put in a new shell where / is now the contents of 3000fs, and you can&amp;#039;t see anything that wasn&amp;#039;t in 3000fs.  Exiting the shell gets you back to where you were.  After exiting, how do you get back to the contained environment?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [1] Run 3000contain.sh.  After 3000contain.sh runs, you&amp;#039;re put in a new shell where / is now the contents of 3000fs, and you can&amp;#039;t see anything that wasn&amp;#039;t in 3000fs.  Exiting the shell gets you back to where you were.  After exiting, how do you get back to the contained environment?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] How does the output of ps differ when run inside the contained environment versus outside?  What command caused this difference?&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# [2] How does the output of ps differ when run inside the contained environment versus outside?  What command caused this difference?&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
	<entry>
		<id>https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24140&amp;oldid=prev</id>
		<title>Soma: Created page with &quot;Please submit the answers to the following questions via Brightspace by November 21, 2022 by 11:59 PM. There are ?? points in ?? questions.  Submit your answers as a plain text file following [https://homeostasis.scs.carleton.ca/~soma/os-2022f/templates/comp3000-a3-template.txt this template].  Name your answer file &quot;comp3000-assign3-&lt;username&gt;.txt&quot; (where username is your MyCarletonOne username).  &#039;&#039;&#039;Please make sure your submission passes the [https://homeostasis.scs.c...&quot;</title>
		<link rel="alternate" type="text/html" href="https://homeostasis.scs.carleton.ca/wiki/index.php?title=Operating_Systems_2022F:_Assignment_3&amp;diff=24140&amp;oldid=prev"/>
		<updated>2022-11-12T02:00:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Please submit the answers to the following questions via Brightspace by November 21, 2022 by 11:59 PM. There are ?? points in ?? questions.  Submit your answers as a plain text file following [https://homeostasis.scs.carleton.ca/~soma/os-2022f/templates/comp3000-a3-template.txt this template].  Name your answer file &amp;quot;comp3000-assign3-&amp;lt;username&amp;gt;.txt&amp;quot; (where username is your MyCarletonOne username).  &amp;#039;&amp;#039;&amp;#039;Please make sure your submission passes the [https://homeostasis.scs.c...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Please submit the answers to the following questions via Brightspace by November 21, 2022 by 11:59 PM. There are ?? points in ?? questions.&lt;br /&gt;
&lt;br /&gt;
Submit your answers as a plain text file following [https://homeostasis.scs.carleton.ca/~soma/os-2022f/templates/comp3000-a3-template.txt this template].  Name your answer file &amp;quot;comp3000-assign3-&amp;lt;username&amp;gt;.txt&amp;quot; (where username is your MyCarletonOne username).  &amp;#039;&amp;#039;&amp;#039;Please make sure your submission passes the [https://homeostasis.scs.carleton.ca/~soma/os-2022f/validators/a3-validator.html assignment validator].&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Don&amp;#039;t forget to include what outside resources you used to complete each of your answers, including other students, man pages, and web resources. You do not need to list help from the instructor, TA, or information found in the textbook.&lt;br /&gt;
&lt;br /&gt;
==Background==&lt;br /&gt;
&lt;br /&gt;
In this assignment you&amp;#039;ll be working with a simple containerized environment.  We&amp;#039;ll create a filesystem, mount it, populate it, and then change the current root directory to it so we can use this environment as if it was a completely separate system.&lt;br /&gt;
&lt;br /&gt;
This mini system is rather bare bones initially and many things won&amp;#039;t work.  You&amp;#039;ll be studying how it is put together and figuring out how to add functionality.  &amp;#039;&amp;#039;You should understand what every line in 3000contain.sh does, even if there isn&amp;#039;t a specific question about it.&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==Tasks/Questions==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Make sure you backup any important files in your VM, as you could erase everything.  You&amp;#039;ve been warned!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
# [2] [https://homeostasis.scs.carleton.ca/~soma/os-2022f/code/3000contain.sh 3000contain.sh].  Is there a risk of data loss from running this script?  Specifically, how much of a risk is there from each rm command?  Be specific.&lt;br /&gt;
# [1] Run 3000contain.sh.  After 3000contain.sh runs, you&amp;#039;re put in a new shell where / is now the contents of 3000fs, and you can&amp;#039;t see anything that wasn&amp;#039;t in 3000fs.  Exiting the shell gets you back to where you were.  After exiting, how do you get back to the contained environment?&lt;br /&gt;
# [2] How does the output of ps differ when run inside the contained environment versus outside?  What command caused this difference?&lt;br /&gt;
# [2] What does line 58 of 3000contain.sh do?  When does it run?  Be sure to explain all of its effects.&lt;br /&gt;
# [2] What is the largest file we can create in the confined environment (once initialized by 3000contain.sh)?  What determines this limit?&lt;br /&gt;
# [2] If you fill up the disk in the host system, how will it change the amount of data that can be stored in the confined environment?  Does this depend on what has been previously stored in the confined environment?&lt;br /&gt;
# [2] Many files in our confined environment refer to the same inode.  What was the original name of this inode?  How do you know?&lt;br /&gt;
# [1] Copy and make nano work in the new environment.  What files did you have to copy to get it to work?  How did you know to copy them?&lt;br /&gt;
# [2] How can you add a user &amp;quot;contain&amp;quot; to 3000fs using useradd (and nothing else)?  Make sure the user also is in a new group &amp;quot;contain&amp;quot; and has a home directory /home/contain (in 3000fs).  This user should only be visible when you&amp;#039;re in the confined environment.  How did you confirm that your answer works?&lt;br /&gt;
# [2] How can you mount the main root filesystem inside of the confined environment?  What part of 3000contain.sh made this possible?&lt;br /&gt;
# [2] How can you change the hostname in the confined environment to &amp;quot;mycontainer&amp;quot; without changing the hostname of the host system?  (Note that the &amp;quot;hostname&amp;quot; command can be used to check and set a system&amp;#039;s hostname.)  Is this change persistent, i.e., will the hostname stay the same when you exit and re-enter the confined environment?&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&lt;br /&gt;
===[https://homeostasis.scs.carleton.ca/~soma/os-2022f/code/3000contain.sh 3000contain.sh]===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;sh&amp;quot; line&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
# 3000contain.sh&lt;br /&gt;
#&lt;br /&gt;
# setup a simple containerized environment in a new&lt;br /&gt;
# filesystem (created in a local file)&lt;br /&gt;
#&lt;br /&gt;
# Anil Somayaji, November 11, 2022&lt;br /&gt;
# School of Computer Science, Carleton University&lt;br /&gt;
# &lt;br /&gt;
# based on 3000makefs.sh from 2021F&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
MP=&amp;#039;3000fs&amp;#039;&lt;br /&gt;
IMAGE=&amp;#039;3000fsimage&amp;#039;&lt;br /&gt;
BLOCKS=60000&lt;br /&gt;
SETUP=&amp;#039;3000setupfs.sh&amp;#039;&lt;br /&gt;
&lt;br /&gt;
if [ $UID != 0 ]; then&lt;br /&gt;
    echo &amp;quot;Please run this script as root.&amp;quot;&lt;br /&gt;
    exit&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
rm -f $IMAGE&lt;br /&gt;
dd if=/dev/zero of=$IMAGE bs=8192 count=$BLOCKS&lt;br /&gt;
mkfs.ext4 $IMAGE&lt;br /&gt;
&lt;br /&gt;
if [ -d $MP ]; then&lt;br /&gt;
    umount -q $MP/dev&lt;br /&gt;
    umount -q $MP&lt;br /&gt;
    rm -rf $MP&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
mkdir $MP&lt;br /&gt;
mount $IMAGE $MP&lt;br /&gt;
cd $MP&lt;br /&gt;
&lt;br /&gt;
mkdir bin sbin usr usr/bin usr/sbin etc proc sys dev root home lib \&lt;br /&gt;
      usr/lib  lib64 tmp var var/tmp var/lib run lib/terminfo&lt;br /&gt;
cp /usr/bin/busybox usr/bin&lt;br /&gt;
&lt;br /&gt;
cp /bin/bash bin&lt;br /&gt;
cp /lib64/ld-linux-x86-64.so.2 lib64&lt;br /&gt;
cp /sbin/ldconfig* sbin&lt;br /&gt;
cp -a /etc/ld.so.conf* etc&lt;br /&gt;
&lt;br /&gt;
cp `ldd /bin/bash | awk &amp;#039;{print $3}&amp;#039;` lib&lt;br /&gt;
&lt;br /&gt;
chmod 1777 tmp var/tmp&lt;br /&gt;
&lt;br /&gt;
cp -a /etc/passwd /etc/shadow /etc/group /etc/gshadow etc&lt;br /&gt;
&lt;br /&gt;
TERMDIR=${TERM:0:1}&lt;br /&gt;
mkdir lib/terminfo/$TERMDIR&lt;br /&gt;
cp /lib/terminfo/$TERMDIR/$TERM lib/terminfo/$TERMDIR/$TERM&lt;br /&gt;
&lt;br /&gt;
echo &amp;#039;#!/usr/bin/busybox sh&amp;#039; &amp;gt; $SETUP&lt;br /&gt;
echo &amp;#039;/usr/bin/busybox --install&amp;#039; &amp;gt;&amp;gt; $SETUP&lt;br /&gt;
echo &amp;#039;/sbin/ldconfig&amp;#039; &amp;gt;&amp;gt; $SETUP&lt;br /&gt;
echo &amp;#039;mount -t devtmpfs udev /dev&amp;#039; &amp;gt;&amp;gt; $SETUP&lt;br /&gt;
&lt;br /&gt;
chmod 0755 $SETUP&lt;br /&gt;
chroot . /$SETUP&lt;br /&gt;
rm $SETUP&lt;br /&gt;
unshare --root=. -f -p --mount-proc&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Soma</name></author>
	</entry>
</feed>