<?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>Ssd – Yeri Tiete</title>
    <link>https://yeri.be/tag/ssd/</link>
    <description>Yeri Tiete&#39;s blog</description>
    <language>en</language>
    <copyright>© Yeri Tiete</copyright>
    <lastBuildDate>Sun, 21 Jun 2020 01:15:02 +0200</lastBuildDate>
    <atom:link href="https://yeri.be/tag/ssd/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Raspberry Pi 4 &#43; SSD</title>
      <link>https://yeri.be/raspberry-pi-4-ssd/</link>
      <pubDate>Sun, 21 Jun 2020 01:15:02 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/raspberry-pi-4-ssd/</guid><enclosure url="https://static.yeri.be/2020/06/IMG_9881.jpg" length="0" type="image/jpeg" />
      <description>&lt;p&gt;All right. With the release of the new &lt;a href=&#34;https://www.raspberrypi.org/blog/8gb-raspberry-pi-4-on-sale-now-at-75/&#34; target=&#34;_blank&#34; rel=&#34;noreferrer noopener&#34;&gt;RPi4 with 8Gb of RAM&lt;/a&gt; I had to get myself one to see if it was already a viable desktop replacement for surfing and emails. &lt;/p&gt;&#xA;&lt;p&gt;While a SD card works fine for certain tasks (things that don&#39;t require a lot of IO) -- for a desktop that&#39;s a no-go... It&#39;s just too slow.&lt;/p&gt;&#xA;&lt;p&gt;I still had an old Macbook Pro 13&#34; (2o15?) SSD lying around that was collecting dust. Why not use that one to use as root for the RPi? &lt;/p&gt;</description>
      <content:encoded><![CDATA[<p><img src="https://static.yeri.be/2020/06/IMG_9881.jpg" alt="Raspberry Pi 4 + SSD"></p><p>All right. With the release of the new <a href="https://www.raspberrypi.org/blog/8gb-raspberry-pi-4-on-sale-now-at-75/" target="_blank" rel="noreferrer noopener">RPi4 with 8Gb of RAM</a> I had to get myself one to see if it was already a viable desktop replacement for surfing and emails. </p>
<p>While a SD card works fine for certain tasks (things that don't require a lot of IO) -- for a desktop that's a no-go... It's just too slow.</p>
<p>I still had an old Macbook Pro 13" (2o15?) SSD lying around that was collecting dust. Why not use that one to use as root for the RPi? </p>
<p>This article will focus on making it work on Raspbian first. Technically this should all work on other distros as well, but <a href="https://www.urbandictionary.com/define.php?term=ymmv" target="_blank" rel="noreferrer noopener">YMMV</a> seeing all this is still beta. </p>
<p>I use Raspbian Lite: I like to work with minimalstic systems and install just what I need. But technically this should work with any flavour. </p>
<p>But first, let's prep the device.</p>
<p><strong>Case</strong></p>
<p>I already have a RPi4 (4Gb) at home running mostly Docker containers (nginx proxy and a few personal things and <a href="https://smokeping-sg.superuser.one/" target="_blank" rel="noreferrer noopener">Smokeping</a>). </p>
<p>And one of the 'best' purchases I made for the RPi4 was the "Raspberry Pi 4 Model B Aluminium Case" (<a href="https://web.archive.org/web/20210125015506/https://www.lazada.sg/products/for-raspberry-pi-4-model-b-aluminum-case-passive-cooling-aluminum-alloy-protective-shell-metal-enclosure-for-raspberry-pi-4-model-b-i738812614-s2377660292.html?mp=1" target="_blank" rel="noreferrer noopener nofollow sponsored">Lazada</a>, <a href="https://www.aliexpress.com/item/33051396297.html?spm=a2g0o.productlist.0.0.125a5bd6Y009xm&amp;algo_pvid=0d7b54ae-8c21-4cee-82ad-201fb4359d0c&amp;algo_expid=0d7b54ae-8c21-4cee-82ad-201fb4359d0c-8&amp;btsid=0ab6fb8315926566848663739ead8c&amp;ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_" target="_blank" rel="noreferrer noopener nofollow sponsored">AliExpress</a>). This case is passive and dissipates enough heat (even in a closed cabinet in Singapore where it's 30°) for the CPU never to throttle back when overclocked at 2Ghz (see below). </p>
<p>Do note that this case (which is pretty much just a massive heat sink) gets pretty hot if the RPi is running at max performance for long periods of time. </p>
<p><strong>USB-SSD</strong></p>
<p>Get one that fits your SSD and that ideally has Linux support. As Apple uses custom SSD connectors (prior to being soldered onto the motherboard) I had to get a converter from China. It was a bit of Russian Roulette to see if it would work or be supported on Linux. I got myself <a href="https://www.aliexpress.com/item/4001014439722.html?spm=a2g0o.productlist.0.0.53e65b1eIgYBZs&amp;algo_pvid=07a65076-95e6-4fe9-962d-7a70c22b8df5&amp;algo_expid=07a65076-95e6-4fe9-962d-7a70c22b8df5-1&amp;btsid=0ab50f4415907422600613293e387b&amp;ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_" rel="noreferrer noopener nofollow sponsored" target="_blank">this one</a> (chipset: Netchip Technology). As I didn't remember what type of Macbook Pro this came from, using <a href="https://beetstech.com/product/solid-state-drive-256gb-655-1803" target="_blank" rel="noreferrer noopener">this site</a> to compare serial/model was useful. This USB-to-SSD converted also works on Mac and Windows by the way. </p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/ssd-enclosure.jpg" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/ssd-enclosure-1024x768.jpg" alt="" class="wp-image-9077"/></a><figcaption>The SSD with the PCB that provides the USB interface.</figcaption></figure></div>
<p>In my case, the RPi also did not provider enough power to the USB-SSD converter (although... it really should but whatevs), so be sure to use the provided power cable and plug it into a USB power source. Not doing so will cause the SSD to heat up and show a bunch of disconnects/errors in <code>dmesg</code>. </p>
<pre class="wp-block-code"><code>raspbian ~ # fdisk -l /dev/sda1 
Disk /dev/sda1: 233.8 GiB, 250999127552 bytes, 490232671 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
raspbian ~ # lsusb 
Bus 002 Device 002: ID 0525:622b Netchip Technology, Inc. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
raspbian ~ # lsusb -t
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    |__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M</code></pre>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/ssd.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/ssd-1024x628.png" alt="Raspberry Pi 4 with USB SSD connected" class="wp-image-9059"/></a><figcaption>Raspberry Pi 4 with USB SSD connected</figcaption></figure></div>
<p><strong>eeprom update</strong></p>
<p>Disconnect the USB-SSD for now.</p>
<p>At the time of writing we need to <a href="https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2711_bootloader_config.md" target="_blank" rel="noreferrer noopener">update</a> the eeprom to boot from USB. I'm using the latest eeprom available to me. Note that the USB-boot eeprom is about to hit stable so you might not need to do this anymore. </p>
<p>There are two methods for updating. We can do it manually:</p>
<pre class="wp-block-code"><code>rpi-update
cd /lib/firmware/raspberrypi/bootloader/beta
rpi-eeprom-update -d -f ./pieeprom-2020-06-15.bin
# BCM2711 detected
# VL805 firmware in bootloader EEPROM
# BOOTFS /boot
# *** INSTALLING ./pieeprom-2020-06-15.bin ***
# BOOTFS /boot
# EEPROM update pending. Please reboot to apply the update.
reboot
# RPi should come back online after a reboot</code></pre>
<p>Or we use <code>rpi-eeprom-update</code> (see <a href="https://www.raspberrypi.org/documentation/hardware/raspberrypi/booteeprom.md" target="_blank" rel="noreferrer noopener">article</a>, at the bottom):</p>
<pre class="wp-block-code"><code>nano -w /etc/default/rpi-eeprom-update
# edit critical to stable
rpi-eeprom-update
rpi-eeprom-update -a</code></pre>
<p>The good thing is that, even if you boot from a Raspbian that does not have <code>/etc/default/rpi-eeprom-update</code> edited to use <code>stable</code> instead of <code>critical</code>, it will not downgrade your eeprom. </p>
<p>Now you can plug in the SD card in an USB-SD card reader, and test if the RPi boots from USB. Note that the SD card might be slower. </p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/rpi-boots-usb-sd.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/rpi-boots-usb-sd-1024x993.png" alt="" class="wp-image-9062"/></a><figcaption>RPi booting the SD card from USB (<code>/dev/sda</code>)</figcaption></figure></div>
<p>All right -- so everything is working. I am keeping this SD card to update the eeprom again at a later stage (as the one we flashed is beta). If we use <a href="https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-4" target="_blank" rel="noreferrer noopener">Archlinux</a> or Ubuntu the eeprom update tools won't be included. </p>
<p>Next step is to flash Raspbian to the USB-SSD. </p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/flash-to-ssd.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/flash-to-ssd-1024x665.png" alt="" class="wp-image-9065"/></a><figcaption>This screenshot shows <a href="https://ubuntu.com/download/raspberry-pi" target="_blank" rel="noreferrer noopener">Ubuntu</a>, but for the sake of this article, we'll use Raspbian still. I'm using <a href="https://www.balena.io/etcher/" target="_blank" rel="noreferrer noopener">Etcher</a> to flash. </figcaption></figure></div>
<p>Boot-up from the USB-SSD. </p>
<p><strong>Errors</strong></p>
<p>In case you are getting an error similar to <code>start4.elf: is not compatible</code> you'll need to copy paste <code>/boot/start4.elf</code> from a Raspbian that ran <code>rpi-update</code> (i.e. the one from the SD card, or see below). </p>
<p>If you are booting (a fresh) Raspbian, it might complain about <code>cma: Failed to reserve 256 MiB</code> (and several other errors). The solution is running <code>rpi-update</code>. </p>
<p>Boot from the working Raspbian (using the SD card):</p>
<pre class="wp-block-code"><code># check which drive is your USB-SSD (i.e. using fdisk -l or dmesg). 
# In my case I booted from USB-SD (/dev/sda) and we'll update the new/clean Raspbian on the SSD (/dev/sdb).
#
# First resize the partition, if the system never booted it'll be 1.5Gb and thus not big enough:
# Device     Boot  Start     End Sectors  Size Id Type
# /dev/sdb1         8192  532479  524288  256M  c W95 FAT32 (LBA)
# /dev/sdb2       532480 3620863 3088384  1.5G 83 Linux
fdisk /dev/sdb
# Type the following:
# p (and visually check it all makes sense)
# d
# 2
# n
# Select (default p): p
# Partition number (2-4, default 2): &lt;enter>
# First sector (2048-490234751, default 2048): 532480 (or whichever is the same "start" from the 2nd partition) 
# Last sector, +/-sectors or +/-size{K,M,G,T,P} (532480-490234751, default 490234751): &lt;enter>
# Created a new partition 2 of type 'Linux' and of size 233.5 GiB.
# Partition #2 contains a ext4 signature.
# Do you want to remove the signature? &#91;Y]es/&#91;N]o: n
# p (visually check once again it makes sense, if not you can cancel/quit by typing q)
# w (if it makes sense)
# The last command will write the changes to the partition table and sync all changes. 
# Then we need to check and resize the filesystem:
e2fsck -f /dev/sdb2
resize2fs /dev/sdb2
# If all that worked we can start mounting everything
mkdir /tmp/ssd
mount /dev/sdb2 /tmp/ssd/
mount /dev/sdb1 /tmp/ssd/boot/
mount /proc/ /tmp/ssd/proc/ -t proc
mount --rbind /sys/ /tmp/ssd/sys/
mount --rbind /dev/ /tmp/ssd/dev/
# Once everything is mounted, we're chrooting into the fresh Raspbian running on the SSD
chroot /tmp/ssd/ /bin/bash
# you can double confirm the partition size using:
df -h
# And we update the system. Again, if all this hits stable it might not be needed.
rpi-update
# say "y" when it's asking you to.
# exit the chroot and turn off the device, remove the USB-SD and leave USB-SSD connected. 
exit 
halt</code></pre>
<p>My first reboot the boot process threw errors about failing to mount the root fs.</p>
<p>We'll need to update <code>/etc/fstab</code> with the correct <code>partuuid</code>. </p>
<pre class="wp-block-code"><code># Boot from the (USB-)SD card again
# In my case sdb became sda and vice versa, so double check
lsblk
# be sure to select the right disk (the SSD, no the SD)!
mkdir /tmp/ssd
mount /dev/sda2 /tmp/ssd/
# And find the SSD here as well.
# look for the last column, partuuid, something like 
"6f6cc2fb-01"
blkid
nano -w /tmp/ssd/etc/fstab
# edit the existing partuuid's with the ones from blkid
# you'll need to edit both /boot (-01) and / (root, -02).
halt
# When rebooting from the SSD it'll go through a fsck. In my case for some reason it failed and dropped to a shell. I did a manual check and everything was fine. Rebooted and it booted normally... *shrug*</code></pre>
<p><strong>Booting</strong></p>
<p>At this stage booting from the USB-SSD should work just fine. You have a working system booting from USB. </p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/rpi4-booted-from-ssd.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/rpi4-booted-from-ssd-1024x714.png" alt="" class="wp-image-9074"/></a><figcaption>It's working! Now I can configure my system. </figcaption></figure></div>
<p><strong>Overclocking</strong></p>
<p>Last thing I'd recommend is getting a bit more juice out of your four cores.</p>
<p>You can quite easily overclock the RPi4 to 2Ghz (per core). It's a pretty nice boost (~25%) and worth going for. I haven't seen any heat issues leading to underclocking (throttling back), and everything runs stable. Note that under real circumstances you are unlikely to be running at 100% for extended period of times. </p>
<p><a href="https://magpi.raspberrypi.org/articles/how-to-overclock-raspberry-pi-4" target="_blank" rel="noreferrer noopener">This guide</a> explains how to overclock Raspbian (but the same applies for <a href="https://ubuntu.com/download/raspberry-pi" target="_blank" rel="noreferrer noopener">Ubuntu RPi</a> -- I'll eventually be using Ubuntu as the OS due to its 64 bit support; at the moment <a href="https://www.raspberrypi.org/forums/viewtopic.php?f=117&amp;t=275370" target="_blank" rel="noreferrer noopener">Raspbian</a> only supports a 64 bit kernel (beta) and the userland still runs 32 bit. But that'll be a follow-up article. </p>
<p>The gist of the article is to edit <code>/boot/config.txt</code> and add:</p>
<pre class="wp-block-code"><code>over_voltage=6
arm_freq=2000</code></pre>
<p>Save the file, reboot and monitor temp (<code>echo $((cat /sys/class/thermal/thermal_zone0/temp/1000))</code>) and core frequency (<code>watch -n 1 vcgencmd measure_clock arm</code>) while running <code>stress -c 4</code> to make sure the cores are running at 100%.</p>
<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://static.yeri.be/2020/06/rpi4-2ghz.png" target="_blank" rel="noopener noreferrer"><img src="https://static.yeri.be/2020/06/rpi4-2ghz-1024x628.png" alt="Raspberry Pi 4 running at 2Ghz" class="wp-image-9058"/></a><figcaption>Raspberry Pi 4 running at 2Ghz. It never throttled back after running for ~30 minutes.</figcaption></figure></div>
]]></content:encoded>
      <category>hardware</category><category>linux</category><category>software</category>
      <category>raspberrypi</category><category>ssd</category><category>usb</category>
    </item>
    
    <item>
      <title>Mounting a RAMFS disk at boot in Mac OS X</title>
      <link>https://yeri.be/mounting-a-ramfs-disk-at-boot-in-mac-os-x/</link>
      <pubDate>Mon, 27 Sep 2010 10:01:27 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/mounting-a-ramfs-disk-at-boot-in-mac-os-x/</guid>
      <description>&lt;p&gt;I received a question about &lt;a href=&#34;https://yeri.be/mac-os-x-ssd-tweaks/&#34;&gt;creating a RAMFS for Mac OS X&amp;rsquo; /tmp folder&lt;/a&gt;, so I&amp;rsquo;ll post my reply here as well.&lt;/p&gt;&#xA;&lt;p&gt;It&amp;rsquo;s really simple;&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;    &lt;li&gt;Open Terminal (Applications -&amp;gt; Utilities), type &#34;&lt;em&gt;sudo su&lt;/em&gt;&#34; and enter your user&#39;s password.&lt;/li&gt;&#xA;    &lt;li&gt;Create a new file in /Library/LaunchDaemons, like this: &#34;&lt;em&gt;nano -w /Library/LaunchDaemons/com.yeri.ramfs.plist&lt;/em&gt;&#34; (you can rename yeri to whatever you like)&lt;/li&gt;&#xA;    &lt;li&gt;And insert following content (ctrl+x to save - y - [enter]):&lt;/li&gt;&#xA;&lt;pre&gt;&amp;lt;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&amp;gt;&#xA;&amp;lt;!DOCTYPE plist PUBLIC &#34;-&amp;#47;&amp;#47;Apple&amp;#47;&amp;#47;DTD PLIST 1.0&amp;#47;&amp;#47;EN&#34; &#xA;&#34;http:&amp;#47;&amp;#47;www.apple.com&amp;#47;DTDs&amp;#47;PropertyList-1.0.dtd&#34;&amp;gt;&#xA;&amp;lt;plist version=&#34;1.0&#34;&amp;gt;&#xA;    &amp;lt;dict&amp;gt;&#xA;        &amp;lt;key&amp;gt;Label&amp;lt;&amp;#47;key&amp;gt;&#xA;        &amp;lt;string&amp;gt;com.yeri.ramfs&amp;lt;&amp;#47;string&amp;gt;&#xA;        &amp;lt;key&amp;gt;ProgramArguments&amp;lt;&amp;#47;key&amp;gt;&#xA;        &amp;lt;array&amp;gt;&#xA;            &amp;lt;string&amp;gt;&amp;#47;var&amp;#47;root&amp;#47;ramfs.sh&amp;lt;&amp;#47;string&amp;gt;&#xA;        &amp;lt;&amp;#47;array&amp;gt;&#xA;        &amp;lt;key&amp;gt;RunAtLoad&amp;lt;&amp;#47;key&amp;gt;&#xA;        &amp;lt;true&amp;#47;&amp;gt;&#xA;    &amp;lt;&amp;#47;dict&amp;gt;&#xA;&amp;lt;&amp;#47;plist&amp;gt;&lt;/pre&gt;&#xA;    &lt;li&gt;create a second file in /var/root/, like this: &#34;&lt;em&gt;nano -w /var/root/ramfs.sh&lt;/em&gt;&#34;&lt;/li&gt;&#xA;    &lt;li&gt;And insert following content:&lt;/li&gt;&#xA;&lt;pre&gt;#!/bin/bash&#xA;ramfs_size_mb=64&#xA;mount_point=/private/tmp&#xA;&lt;p&gt;ramfs_size_sectors=$((${ramfs_size_mb}&lt;em&gt;1024&lt;/em&gt;1024/512))&#xA;ramdisk_dev=&lt;code&gt;hdid -nomount ram://${ramfs_size_sectors}&lt;/code&gt;&#xA;newfs_hfs -v &amp;lsquo;Volatile HD&amp;rsquo; ${ramdisk_dev}&#xA;mkdir -p ${mount_point}&#xA;mount -o noatime -t hfs ${ramdisk_dev} ${mount_point}&#xA;chown root:wheel ${mount_point}&#xA;chmod 1777 ${mount_point}&lt;/pre&gt;&#xA;&lt;li&gt;chmod +x ramfs.sh and reboot. Check in Terminal with &amp;ldquo;mount&amp;rdquo; or &amp;ldquo;df -h&amp;rdquo; is everything is fine. To hide the disk icon on your desktop, check my &lt;a href=&#34;https://yeri.be/mac-os-x-ssd-tweaks/&#34;&gt;old blog post&lt;/a&gt;.&lt;/li&gt;&#xA;&lt;li&gt;In case Mac didn&amp;rsquo;t do so already, you might want to link /tmp to /private/tmp: &amp;ldquo;&lt;em&gt;rm -r /tmp &amp;amp;&amp;amp; ln -s /private/tmp /tmp&lt;/em&gt;&amp;rdquo;.&lt;/li&gt;&#xA;&lt;li&gt;Should be it !&lt;/li&gt;&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>I received a question about <a href="https://yeri.be/mac-os-x-ssd-tweaks/">creating a RAMFS for Mac OS X&rsquo; /tmp folder</a>, so I&rsquo;ll post my reply here as well.</p>
<p>It&rsquo;s really simple;</p>
<ol>
    <li>Open Terminal (Applications -&gt; Utilities), type "<em>sudo su</em>" and enter your user's password.</li>
    <li>Create a new file in /Library/LaunchDaemons, like this: "<em>nano -w /Library/LaunchDaemons/com.yeri.ramfs.plist</em>" (you can rename yeri to whatever you like)</li>
    <li>And insert following content (ctrl+x to save - y - [enter]):</li>
<pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-&#47;&#47;Apple&#47;&#47;DTD PLIST 1.0&#47;&#47;EN" 
"http:&#47;&#47;www.apple.com&#47;DTDs&#47;PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
    &lt;dict&gt;
        &lt;key&gt;Label&lt;&#47;key&gt;
        &lt;string&gt;com.yeri.ramfs&lt;&#47;string&gt;
        &lt;key&gt;ProgramArguments&lt;&#47;key&gt;
        &lt;array&gt;
            &lt;string&gt;&#47;var&#47;root&#47;ramfs.sh&lt;&#47;string&gt;
        &lt;&#47;array&gt;
        &lt;key&gt;RunAtLoad&lt;&#47;key&gt;
        &lt;true&#47;&gt;
    &lt;&#47;dict&gt;
&lt;&#47;plist&gt;</pre>
    <li>create a second file in /var/root/, like this: "<em>nano -w /var/root/ramfs.sh</em>"</li>
    <li>And insert following content:</li>
<pre>#!/bin/bash
ramfs_size_mb=64
mount_point=/private/tmp
<p>ramfs_size_sectors=$((${ramfs_size_mb}<em>1024</em>1024/512))
ramdisk_dev=<code>hdid -nomount ram://${ramfs_size_sectors}</code>
newfs_hfs -v &lsquo;Volatile HD&rsquo; ${ramdisk_dev}
mkdir -p ${mount_point}
mount -o noatime -t hfs ${ramdisk_dev} ${mount_point}
chown root:wheel ${mount_point}
chmod 1777 ${mount_point}</pre>
<li>chmod +x ramfs.sh and reboot. Check in Terminal with &ldquo;mount&rdquo; or &ldquo;df -h&rdquo; is everything is fine. To hide the disk icon on your desktop, check my <a href="https://yeri.be/mac-os-x-ssd-tweaks/">old blog post</a>.</li>
<li>In case Mac didn&rsquo;t do so already, you might want to link /tmp to /private/tmp: &ldquo;<em>rm -r /tmp &amp;&amp; ln -s /private/tmp /tmp</em>&rdquo;.</li>
<li>Should be it !</li></p>
</ol>
]]></content:encoded>
      <category>apple</category><category>hardware</category><category>software</category>
      <category>ssd</category>
    </item>
    
    <item>
      <title>Mac OS X &#43; SSD tweaks</title>
      <link>https://yeri.be/mac-os-x-ssd-tweaks/</link>
      <pubDate>Tue, 08 Jun 2010 15:17:59 +0200</pubDate>
      <author>Yeri Tiete</author>
      <guid isPermaLink="true">https://yeri.be/mac-os-x-ssd-tweaks/</guid>
      <description>&lt;p&gt;Came across a &lt;a href=&#34;https://web.archive.org/web/20180124175530/http://blogs.nullvision.com:80/?p=275&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;pretty cool howto&lt;/a&gt; to tweak &lt;a href=&#34;http://www.flickr.com/photos/tuinslak/4663129200/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;your&lt;/a&gt; &lt;a href=&#34;http://www.flickr.com/photos/tuinslak/4662482847/sizes/l/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;SSD on a Mac&lt;/a&gt;.  Only thing I noticed is setting the hibernate mode to 0 made my mac randomly wake up a few seconds after it went to sleep (and happened most often when closing the lid, less often when clicking the sleep button; randomly closing apps seemed to sometimes fix this problem; usually closing Skype and VLC solved this&amp;hellip;)  Set it the &lt;a href=&#34;https://web.archive.org/web/20120226054447/http://www.macworld.com:80/article/53471/2006/10/sleepmode.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;hibernate mode&lt;/a&gt; 7 now (which was the default I think)&lt;/p&gt;</description>
      <content:encoded><![CDATA[<p>Came across a <a href="https://web.archive.org/web/20180124175530/http://blogs.nullvision.com:80/?p=275" target="_blank" rel="noopener noreferrer">pretty cool howto</a> to tweak <a href="http://www.flickr.com/photos/tuinslak/4663129200/" target="_blank" rel="noopener noreferrer">your</a> <a href="http://www.flickr.com/photos/tuinslak/4662482847/sizes/l/" target="_blank" rel="noopener noreferrer">SSD on a Mac</a>.  Only thing I noticed is setting the hibernate mode to 0 made my mac randomly wake up a few seconds after it went to sleep (and happened most often when closing the lid, less often when clicking the sleep button; randomly closing apps seemed to sometimes fix this problem; usually closing Skype and VLC solved this&hellip;)  Set it the <a href="https://web.archive.org/web/20120226054447/http://www.macworld.com:80/article/53471/2006/10/sleepmode.html" target="_blank" rel="noopener noreferrer">hibernate mode</a> 7 now (which was the default I think)</p>
<pre style="padding-left: 30px;">yeri$ sudo pmset -g | grep hibernatemode
hibernatemode   7</pre>
<pre style="padding-left: 30px;">yeri$ mount
/dev/disk0s2 on / (hfs, local, journaled, <strong>noatime</strong>)
...
/dev/disk2     256Mi  6.0Mi  250Mi     3%    /private/tmp</pre>
<p>I did indeed, as noted in the above howto/blog post, that shutting down is slower. Not that much, just a bit. As I usually don&rsquo;t shut down, I guess this isn&rsquo;t much of a problem.  However, this additional mount point creates a disk on my desktop (or in finder), which is annoying.</p>
<p style="text-align: center;"><a href="https://static.yeri.be/2010/06/Screen-shot-2010-06-08-at-14.40.23.png"><img class="size-full wp-image-1482 aligncenter" title="ramfs disk mac os x" src="https://static.yeri.be/2010/06/Screen-shot-2010-06-08-at-14.40.23.png" alt="" width="133" height="117" /></a></p>
<p>However, this <a href="https://web.archive.org/web/20110918163656/http://blog.julipedia.org:80/2007/01/hide-volume-in-mac-os-x.html" target="_blank" rel="noopener noreferrer">seems fixable</a> with</p>
<pre style="padding-left: 30px;">/Developer/Tools/SetFile -a V /private/tmp/</pre>
<p>But, this option seems forgotten after a reboot and has to be started over. Crappy.</p>
<p>So, tried with <a href="http://www.macworld.com/article/132782/2008/04/finderhidetm.html" target="_blank" rel="noopener noreferrer">AppleScript</a> then, created a new script with following content:</p>
<pre style="padding-left: 30px;">quit application "Finder"
tell application "System Events" to ¬
set visible of disk "Volatile HD" to false
delay 0.1
launch application "Finder"</pre>
<p>And saved it as &ldquo;File Format: Application&rdquo; and &ldquo;Options: Run Only&rdquo;. The delay line is needed, as without it, finder doesn&rsquo;t seem to start/reopen its folders/show desktop icons until  you click its icon again in the Dock. You can change the delay to 1, but that was a bit slow for me; tried a delay of 0.0001 too, but that gave the same issue as not putting in a delay line in at all.</p>
<p>You can just download the script/application <a href="https://static.yeri.be/2010/06/hideVolatileDisk.zip" target="_blank" rel="noopener noreferrer">here</a>.</p>
<p>Drag the application to the Application folder, and add a start up item for it (System Preferences -&gt; Accounts -&gt; YOU -&gt; Login Items; click the +-button and browse till you find your application). Should do the trick.</p>
<p>I also changed the ramfs disk size to 128Mb instead of 256Mb, as 256Mb seemed a lot for a disk that was using ~10Mb.</p>
]]></content:encoded>
      <category>apple</category><category>hardware</category><category>software</category>
      <category>ssd</category>
    </item>
    
  </channel>
</rss>
