<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Partition on Details...</title>
    <link>https://www.deepreflect.net/tags/partition/</link>
    <description>Recent content in Partition on Details...</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    <copyright>Copyright © 2003 - 2026 Leonardo Rizzi</copyright>
    <lastBuildDate>Tue, 30 Jun 2026 03:28:29 +0200</lastBuildDate>
    <atom:link href="https://www.deepreflect.net/tags/partition/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Recovery HFS partition table</title>
      <link>https://www.deepreflect.net/2012/03/25/recovery-hfs-partition-table/</link>
      <pubDate>Sun, 25 Mar 2012 15:48:13 +0000</pubDate>
       <guid isPermaLink="false">http://blog.deepreflect.net/?p=1175</guid> 
      <description>&lt;p&gt;First think, scan your damage disk with a tool like &amp;ldquo;testdisk&amp;rdquo; (&lt;a href=&#34;http://www.cgsecurity.org/wiki/TestDisk&#34;&gt;http://www.cgsecurity.org/wiki/TestDisk&lt;/a&gt;) look for lost partitions, unfortunately HFS is not fully supported by this great tool, then you need to use pdisk or other partition software.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; Disk /dev/rdisk3 - 1000 GB / 931 GiB - CHS 121601 255 63
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; Partition Start End Size in sectors
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &amp;gt;P HFS 262208 1953525151 1953262944
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In my case, I&amp;rsquo;ve used pdisk directly on OS X:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>First think, scan your damage disk with a tool like &ldquo;testdisk&rdquo; (<a href="http://www.cgsecurity.org/wiki/TestDisk">http://www.cgsecurity.org/wiki/TestDisk</a>) look for lost partitions, unfortunately HFS is not fully supported by this great tool, then you need to use pdisk or other partition software.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span> Disk /dev/rdisk3 - 1000 GB / 931 GiB - CHS 121601 255 63
</span></span><span style="display:flex;"><span> Partition Start End Size in sectors
</span></span><span style="display:flex;"><span> &gt;P HFS 262208 1953525151 1953262944
</span></span></code></pre></div><p>In my case, I&rsquo;ve used pdisk directly on OS X:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span> leobook4-w:~ root# pdisk /dev/rdisk3
</span></span><span style="display:flex;"><span> pdisk: No valid block 1 on &#39;/dev/rdisk3&#39;
</span></span><span style="display:flex;"><span> Edit /dev/rdisk3 -
</span></span><span style="display:flex;"><span> Command (? for help): i
</span></span><span style="display:flex;"><span> A physical block is 512 bytes:
</span></span><span style="display:flex;"><span> A logical block is 512 bytes:
</span></span><span style="display:flex;"><span> size of &#39;device&#39; is 1953525168 blocks (512 byte blocks):
</span></span><span style="display:flex;"><span> new size of &#39;device&#39; is 1953525168 blocks (512 byte blocks)
</span></span><span style="display:flex;"><span> Command (? for help): c
</span></span><span style="display:flex;"><span> First block: 262208
</span></span><span style="display:flex;"><span> Length in blocks: 1953262944
</span></span><span style="display:flex;"><span> Name of partition: recover\_leo
</span></span><span style="display:flex;"><span> Command (? for help): w
</span></span><span style="display:flex;"><span> Writing the map destroys what was there before. Is that okay? \[n/y\]: y
</span></span><span style="display:flex;"><span> The partition table has been altered!
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span> Command (? for help): q
</span></span></code></pre></div>]]></content:encoded>
    </item>
    <item>
      <title>Solaris - Add swap to ZFS disk</title>
      <link>https://www.deepreflect.net/2010/02/11/solaris-add-swap-to-zfs-disk/</link>
      <pubDate>Thu, 11 Feb 2010 09:38:47 +0000</pubDate>
       <guid isPermaLink="false">http://blog.deepreflect.net/?p=814</guid> 
      <description>&lt;p&gt;I installed Solaris 10 05/09 on a machine and I used whatever the default swap space setting when I built the box. Now I need to increase the swap space and I can&amp;rsquo;t add a swap file, like was possible under UFS.&lt;/p&gt;
&lt;p&gt;If your swap device is in use, then you might not be able to delete it. Check to see if the swap area is in use. For example:&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I installed Solaris 10 05/09 on a machine and I used whatever the default swap space setting when I built the box. Now I need to increase the swap space and I can&rsquo;t add a swap file, like was possible under UFS.</p>
<p>If your swap device is in use, then you might not be able to delete it. Check to see if the swap area is in use. For example:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>$ swap -l
</span></span><span style="display:flex;"><span>swapfile                 dev    swaplo   blocks     free
</span></span><span style="display:flex;"><span>/dev/zvol/dsk/rpool/swap 182,2         8  4194296  4194296
</span></span></code></pre></div><p>In the above output, blocks == free, so the swap device is not actually being used.</p>
<p>If the swap area is not is use, remove the swap area. For example:</p>
<p><code>$ swap -d /dev/zvol/dsk/rpool/swap</code></p>
<p>Confirm that the swap area is removed.</p>
<p><code>$ swap -l</code></p>
<p>No swap devices configured</p>
<p>Resize the swap volume. For example:</p>
<p><code>$ zfs set volsize=1G rpool/swap</code></p>
<p>Activate the swap area.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span>$ swap -a /dev/zvol/dsk/rpool/swap` `$ swap -l
</span></span><span style="display:flex;"><span>swapfile                 dev    swaplo   blocks     free
</span></span><span style="display:flex;"><span>/dev/zvol/dsk/rpool/swap 182,2         8  2097144  2097144
</span></span></code></pre></div>]]></content:encoded>
    </item>
    <item>
      <title>Securing &#34;tmp&#34; without repartition</title>
      <link>https://www.deepreflect.net/2010/01/16/securing-tmp/</link>
      <pubDate>Sat, 16 Jan 2010 22:57:24 +0000</pubDate>
       <guid isPermaLink="false">http://blog.deepreflect.net/?p=786</guid> 
      <description>&lt;ol&gt;
&lt;li&gt;First you should secure /tmp:&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Make a 1GB file for /tmp parition and an ext3 filesystem for tmp:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# dd if=/dev/zero of=/dev/tmpFS bs=1024 count=1000000
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# /sbin/mkfs.ext3 /dev/tmpFS
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Create a backup copy of your current /tmp drive:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;# cp -Rpf /tmp /tmpbackup&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Mount our new tmp parition and change permissions:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# mount -o loop,noexec,nosuid,rw /dev/tmpFS /tmp
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;# chmod 1777 /tmp
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Copy the old data:
&lt;code&gt;cp -Rpf /tmpbackup/\* /tmp/&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you run the mount command and you should get something like this:
&lt;code&gt;/dev/tmpMnt on /tmp type ext3 (rw,noexec,nosuid,loop=/dev/loop0)&lt;/code&gt;&lt;/p&gt;</description>
      <content:encoded><![CDATA[<ol>
<li>First you should secure /tmp:</li>
</ol>
<p>Make a 1GB file for /tmp parition and an ext3 filesystem for tmp:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span># dd if=/dev/zero of=/dev/tmpFS bs=1024 count=1000000
</span></span><span style="display:flex;"><span># /sbin/mkfs.ext3 /dev/tmpFS
</span></span></code></pre></div><p>Create a backup copy of your current /tmp drive:</p>
<p><code># cp -Rpf /tmp /tmpbackup</code></p>
<p>Mount our new tmp parition and change permissions:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-fallback" data-lang="fallback"><span style="display:flex;"><span># mount -o loop,noexec,nosuid,rw /dev/tmpFS /tmp
</span></span><span style="display:flex;"><span># chmod 1777 /tmp
</span></span></code></pre></div><p>Copy the old data:
<code>cp -Rpf /tmpbackup/\* /tmp/</code></p>
<p>If you run the mount command and you should get something like this:
<code>/dev/tmpMnt on /tmp type ext3 (rw,noexec,nosuid,loop=/dev/loop0)</code></p>
<p>Edit /etc/fstab and add this:</p>
<p><code>/dev/tmpMnt /tmp ext3 loop,nosuid,noexec,rw 0 0</code></p>
<p>Test your fstab entry:</p>
<p><code># mount -o remount /tmp</code></p>
<p>You can test it runnig a script on /tmp partition, if you get &ldquo;permission denied&rdquo; it is fine :)</p>
<ol start="2">
<li>Secure /var/tmp:</li>
</ol>
<p>It should be done because some applications use /var/tmp as the temporary folder, and anything that&rsquo;s accessible by all, needs to be secured.</p>
<p>Rename it and create a symbolic link to /tmp:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"><code class="language-gdscript3" data-lang="gdscript3"><span style="display:flex;"><span><span style="color:#75715e"># mv /var/tmp /var/tmp1</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># ln -s /tmp /var/tmp </span>
</span></span></code></pre></div><p>Copy the old data back:</p>
<p><code># cp /var/tmpold/* /tmp/</code></p>
<p>Note: you should restart and services that uses /tmp partition</p>
]]></content:encoded>
    </item>
  </channel>
</rss>
