<!--
Scheduled with permission from the Mailing list as these shows were submitted under the old first-in-first-out rules.
-->

<h2>Utilizing Maximum Space on a Cloned BTRFS Partition</h2>
<h3>by FiftyOneFifty</h3>

<ol>
    <li>If you clone a disk to a disk, Clonezilla will increase (decrease) the size of each partition proportional to the relative size of the drives.
	<ol>
	<li>I wanted to keep my / the same size and have no swap (new drive was SSD), so I did a partition to partition clone instead</li>
	<li>Created partitions on the new SSDs with a GParted Live CD, 12Gb root (Ext4) and the remainder for /home, (btrfs, because I planned to move to SSD from the start, and last summer only btrfs supported TRIM)</li>
	</ol>
    </li>
    <li>After cloning /dev/sda1 to /dev/sdb1 and /dev/sda2 to /dev/sdb2 using Clonezilla, I inspected the new volumes with the GParted Live CD
	<ol>
	    <li>/dev/sdb2 had 40% inaccessible space, i.e., the usable space was the same size as the old /home volume</li>
	    <li>GParted flagged the error and said I could correct it from the menu (Partition-&gt;Check) but btrfs doesn't support fsck, so it didn't work</li>
	    <li>Tried shrinking the volume in GParted and re-expanding it to take up the free space, also didn't work.</li>
	</ol>
    </li>
    <li>Discovered 'btrfs utility' and that it was supported by the GParted Live CD
	<ol>
	    <li>Make a mount point
		<ul>
		    <li><code>sudo mkdir /media/btrfs</code></li>
		</ul>
	    </li>
	    <li>Mount the btrfs volume
		<ul>
		    <li><code>sudo mount /dev/sdb2 /media/btrfs</code></li>
		</ul>
	    </li>
	    <li>Use btrfs utility to expand the btrfs file system to the maximum size of the volume
		<ul>
		    <li><code>sudo btrfs filesystem resize max /media/btrfs</code></li>
		</ul>
	    </li>
	    <li>Unmount the btrfs volume
		<ul>
		    <li><code>sudo umount /dev/sdb2</code></li>
		</ul>
	    </li>
	</ol>
    </li>
    <li>Rechecked /dev/sdb2 with GParted, I no longer had inaccessible space</li>
</ol>
