<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lotjuh&#039;s notes &#187; annoying</title>
	<atom:link href="http://notes.lotjuh.winnipeg.nl/tag/annoying/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.lotjuh.winnipeg.nl</link>
	<description></description>
	<lastBuildDate>Mon, 05 Oct 2009 11:36:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Freebsd unremoveable directories</title>
		<link>http://notes.lotjuh.winnipeg.nl/howto/freebsd-unremoveable-directories/</link>
		<comments>http://notes.lotjuh.winnipeg.nl/howto/freebsd-unremoveable-directories/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 11:36:08 +0000</pubDate>
		<dc:creator>Lotjuh</dc:creator>
				<category><![CDATA[How to's]]></category>
		<category><![CDATA[annoying]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[how to]]></category>

		<guid isPermaLink="false">http://notes.lotjuh.winnipeg.nl/?p=93</guid>
		<description><![CDATA[When I was trying to get my FreeBSD working as a XenU, I used the make option DESTDIR= for installworld and installkernel.
After the files had been installed in my DESTDIR directory however, I wasn&#8217;t able to remove certain directories when I tried to remove my DESTDIR for a clean new install:
rm: /usr/local/xen/current-root/bin/rcp: Operation not permitted
rm: [...]]]></description>
			<content:encoded><![CDATA[<p>When I was trying to get my FreeBSD working as a XenU, I used the make option DESTDIR= for installworld and installkernel.<br />
After the files had been installed in my DESTDIR directory however, I wasn&#8217;t able to remove certain directories when I tried to remove my DESTDIR for a clean new install:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;height:300px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rcp: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>bin: Directory not empty<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libc.so.7: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libcrypt.so.5: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>libthr.so.3: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>lib: Directory not empty<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>ld-elf.so.1: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>libexec: Directory not empty<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>init: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>sbin: Directory not empty<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>chpass: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">chfn</span>: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">chsh</span>: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ypchpass: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ypchfn: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ypchsh: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">login</span>: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>opieinfo: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>opiepasswd: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">passwd</span>: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>yppasswd: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rlogin: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">rsh</span>: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">su</span>: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>crontab: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin: Directory not empty<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>librt.so.1: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib: Directory not empty<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>usr: Directory not empty<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>empty: Operation not permitted<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<span style="color: #000000; font-weight: bold;">/</span>var: Directory not empty<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span>: <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root: Directory not empty</div></div>
<p>After getting really annoyed with all the directories piling up in my /usr/local/xen directory, Benv offered to try and find out why the hell these directories didn&#8217;t want to get deleted.<br />
It seemed that the directories had a flag &#8217;schg&#8217; which you can see by doing an &#8216;ls -lo&#8217; on the directory. The &#8217;schg&#8217; flag means that the directory is system immutable and only the owner and superuser are allowed to remove this flag.<br />
This is done by calling chflags 0 on the directory. This clears all it&#8217;s flags.</p>
<p>I fixed my problem by doing:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root<br />
<span style="color: #c20cb9; font-weight: bold;">find</span> . <span style="color: #660033;">-exec</span> chflags <span style="color: #000000;">0</span> <span style="color: #ff0000;">&quot;{}&quot;</span> \;<br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>current-root</div></div>
]]></content:encoded>
			<wfw:commentRss>http://notes.lotjuh.winnipeg.nl/howto/freebsd-unremoveable-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

