<?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>sleeplessbeastie&#039;s notes</title>
	<atom:link href="http://blog.sleeplessbeastie.eu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sleeplessbeastie.eu</link>
	<description>I just don&#039;t want to die without a few scars. ~ Fight Club, Chuck Palahniuk</description>
	<lastBuildDate>Fri, 18 May 2012 22:19:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to use VideoLAN in live mode?</title>
		<link>http://blog.sleeplessbeastie.eu/2012/05/19/how-to-use-videolan-in-live-mode/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/05/19/how-to-use-videolan-in-live-mode/#comments</comments>
		<pubDate>Fri, 18 May 2012 22:19:49 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vlc]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=462</guid>
		<description><![CDATA[After I started my journey with squashfs I encountered problem with VideoLAN as I couldn&#8217;t start it. Problem Error message: $ vlc VLC media player 2.0.1 Twoflower (revision 2.0.1-0-gf432547) [0x23b9108] main libvlc error: No plugins found! Check your VLC installation. More verbose output: $ vlc -v VLC media player 2.0.1 Twoflower (revision 2.0.1-0-gf432547) [0x1b8c108] main [...]]]></description>
			<content:encoded><![CDATA[<p>After I started my journey with <em>squashfs</em> I encountered problem with <a href="http://www.videolan.org/">VideoLAN</a> as I couldn&#8217;t start it.</p>
<p><strong>Problem</strong></p>
<p>Error message:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ vlc
VLC media player 2.0.1 Twoflower (revision 2.0.1-0-gf432547)
[0x23b9108] main libvlc error: No plugins found! Check your VLC installation.</pre></div></div>

<p>More verbose output:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ vlc -v
VLC media player 2.0.1 Twoflower (revision 2.0.1-0-gf432547)
[0x1b8c108] main libvlc warning: cannot read /livefs.squashfs/usr/lib/vlc/plugins/plugins.dat (No such file or directory)
[0x1b8c108] main libvlc error: No plugins found! Check your VLC installation.</pre></div></div>

<p>As seen above it just searched for plugins in non-existent place. </p>
<p><strong>Solution 1</strong></p>
<p>Create a symbolic link so <em>VideoLAN</em> would see plugins:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo ln -s / /livefs.squashfs</pre></div></div>

<p><strong>Solution 2</strong></p>
<p>Use environmental variable so VideoLAN would use correct path:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ export VLC_PLUGIN_PATH=/usr/lib/vlc/plugins/</pre></div></div>

<p><strong>Footnotes</strong></p>
<p>I found these solutions while reading <a href="http://forums.linuxmint.com/viewtopic.php?f=196&#038;t=100508">Linux Mint Forums</a> and <a href="http://forum.videolan.org/viewtopic.php?f=32&#038;t=88878">the videolan forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/05/19/how-to-use-videolan-in-live-mode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to download YouTube videos using console application?</title>
		<link>http://blog.sleeplessbeastie.eu/2012/05/17/how-to-download-youtube-videos-using-console-application/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/05/17/how-to-download-youtube-videos-using-console-application/#comments</comments>
		<pubDate>Wed, 16 May 2012 22:58:45 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=461</guid>
		<description><![CDATA[The easiest way to download YouTube videos is to use youtube-dl. To install it using Debian based distribution like Ubuntu use command: $ sudo apt-get install youtube-dl Example usage: $ youtube-dl http://www.youtube.com/watch?v=O5D1O7eb_H4 [youtube] Setting language [youtube] O5D1O7eb_H4: Downloading video webpage [youtube] O5D1O7eb_H4: Downloading video info webpage [youtube] O5D1O7eb_H4: Extracting video information [download] Destination: O5D1O7eb_H4.flv [download] [...]]]></description>
			<content:encoded><![CDATA[<p>The easiest way to download YouTube videos is to use <a href="http://rg3.github.com/youtube-dl/" title="youtube-dl">youtube-dl</a>.</p>
<p>To install it using Debian based  distribution like Ubuntu use command:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo apt-get install youtube-dl</pre></div></div>

<p>Example usage:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ youtube-dl http://www.youtube.com/watch?v=O5D1O7eb_H4
[youtube] Setting language
[youtube] O5D1O7eb_H4: Downloading video webpage
[youtube] O5D1O7eb_H4: Downloading video info webpage
[youtube] O5D1O7eb_H4: Extracting video information
[download] Destination: O5D1O7eb_H4.flv
[download] 100.0% of 124.37M at   87.78k/s ETA 00:00</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/05/17/how-to-download-youtube-videos-using-console-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to backup DOS-type partition table/GPT and LVM metadata?</title>
		<link>http://blog.sleeplessbeastie.eu/2012/05/14/how-to-backup-dos-type-partition-table-gpt-and-lvm-metadata/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/05/14/how-to-backup-dos-type-partition-table-gpt-and-lvm-metadata/#comments</comments>
		<pubDate>Sun, 13 May 2012 23:49:34 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=460</guid>
		<description><![CDATA[DOS partion table We can use sfdisk to dump partition table in usable format and store it: $ sudo sfdisk -d /dev/sda &#62; sda_partitions Partition table can be restored using stored backup: $ sudo sfdisk /dev/sda &#60; sda_partitions Partition table can be easily cloned (from sda to sdz in this example): $ sudo sfdisk -d [...]]]></description>
			<content:encoded><![CDATA[<p><strong>DOS partion table</strong></p>
<p>We can use <em>sfdisk</em> to dump partition table in usable format and store it:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo sfdisk -d /dev/sda &gt; sda_partitions</pre></div></div>

<p>Partition table can be restored using stored backup:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo sfdisk /dev/sda &lt; sda_partitions</pre></div></div>

<p>Partition table can be easily cloned (from <em>sda</em> to <em>sdz</em> in this example):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo sfdisk -d /dev/sda | sfdisk /dev/sdz</pre></div></div>

<p><br/><br />
<strong>GPT</strong></p>
<p>To backup GUID partition table use <em>sgdisk</em> command (from <em>gdisk</em> package):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo sgdisk -b sda_gpt_backup /dev/sda</pre></div></div>

<p>Restore it in similar way:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo sgdisk -l sda_gpt_backup /dev/sda</pre></div></div>

<p><br/><br />
<strong>LVM</strong></p>
<p>To backup LVM metadata for volume group <em>vol_test</em> to <em>vol_test_backup</em> file use command:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo lvm vgcfgbackup -f vol_test_backup vol_test</pre></div></div>

<p>To restore volume group metadata use similar command:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo lvm vgcfgbackup -f vol_test_backup vol_test</pre></div></div>

<p>To restore physical volume metadata (with specified UUID to /dev/sda1 device):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo pvcreate --restorefile vol_test_backup --uuid rRD... /dev/sda1</pre></div></div>

<p>There is a little more work to be done in this case (beyond this short post) so jump directly to <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/index.html">Red Hat &#8211; Logical Volume Manager Administration</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/05/14/how-to-backup-dos-type-partition-table-gpt-and-lvm-metadata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to check stored WiFi passwords on Android 2.1?</title>
		<link>http://blog.sleeplessbeastie.eu/2012/05/11/how-to-check-stored-wifi-passwords-on-android-2-1/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/05/11/how-to-check-stored-wifi-passwords-on-android-2-1/#comments</comments>
		<pubDate>Fri, 11 May 2012 08:55:24 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=456</guid>
		<description><![CDATA[On rooted phone go to /data/misc/wifi/ directory and open wpa_supplicant.conf file. In case of any questions look at the screen shots below.]]></description>
			<content:encoded><![CDATA[<p>On rooted phone go to <em>/data/misc/wifi/</em> directory and open <em>wpa_supplicant.conf</em> file.</p>
<p>In case of any questions look at the screen shots below.</p>

<a href='http://blog.sleeplessbeastie.eu/2012/05/11/how-to-check-stored-wifi-passwords-on-android-2-1/root_explorer/' title='root_explorer'><img width="112" height="150" src="http://blog.sleeplessbeastie.eu/wp-content/uploads/2012/05/root_explorer-112x150.png" class="attachment-thumbnail" alt="root_explorer" title="root_explorer" /></a>
<a href='http://blog.sleeplessbeastie.eu/2012/05/11/how-to-check-stored-wifi-passwords-on-android-2-1/wpa_supplicant/' title='wpa_supplicant'><img width="112" height="150" src="http://blog.sleeplessbeastie.eu/wp-content/uploads/2012/05/wpa_supplicant-112x150.png" class="attachment-thumbnail" alt="wpa_supplicant" title="wpa_supplicant" /></a>

]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/05/11/how-to-check-stored-wifi-passwords-on-android-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get disk UUID?</title>
		<link>http://blog.sleeplessbeastie.eu/2012/05/10/how-to-get-disk-uuid/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/05/10/how-to-get-disk-uuid/#comments</comments>
		<pubDate>Thu, 10 May 2012 17:50:20 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=455</guid>
		<description><![CDATA[Recently I needed to know UUID (universally unique identifier) of my bootable USB root partition as it is better way to distinguish storage devices because (external) device names can change depending on connection order. There are at least couple of ways to get UUIDs and not all of them require root access: $ ls -l [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I needed to know UUID (universally unique identifier) of my bootable USB root partition as it is better way to distinguish storage devices because (external) device names can change depending on connection order.</p>
<p>There are at least couple of ways to get UUIDs and not all of them require root access:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ ls -l /dev/disk/by-uuid/* 
lrwxrwxrwx 1 root root 10 maj  9 18:05 /dev/disk/by-uuid/5d2f85fe-b555-4504-a87f-3d1c6513c7d4 -&gt; ../../sda2
lrwxrwxrwx 1 root root 10 maj  9 18:05 /dev/disk/by-uuid/678e905f-68cc-449e-99a9-cb90d7011d23 -&gt; ../../sdb1
lrwxrwxrwx 1 root root 10 maj  9 18:05 /dev/disk/by-uuid/687aa5e4-3863-4529-a8bf-fa526716f523 -&gt; ../../sdb2
lrwxrwxrwx 1 root root 10 maj  9 18:05 /dev/disk/by-uuid/8252dada-3e65-401b-b0cf-0123a7b62df6 -&gt; ../../sda1
lrwxrwxrwx 1 root root 10 maj  9 18:05 /dev/disk/by-uuid/8b19014d-442a-4e2e-8367-569f000afaa0 -&gt; ../../sda3</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ ls /dev/disk/by-uuid/* | xargs file
/dev/disk/by-uuid/5d2f85fe-b555-4504-a87f-3d1c6513c7d4: symbolic link to `../../sda2'
/dev/disk/by-uuid/678e905f-68cc-449e-99a9-cb90d7011d23: symbolic link to `../../sdb1'
/dev/disk/by-uuid/687aa5e4-3863-4529-a8bf-fa526716f523: symbolic link to `../../sdb2'
/dev/disk/by-uuid/8252dada-3e65-401b-b0cf-0123a7b62df6: symbolic link to `../../sda1'
/dev/disk/by-uuid/8b19014d-442a-4e2e-8367-569f000afaa0: symbolic link to `../../sda3'</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ find /dev/disk/by-uuid/* -exec echo -n {} &quot;-&gt; &quot; \; -exec readlink {} \; | sort -k2 | sed 's/\.\.\///g'
/dev/disk/by-uuid/8252dada-3e65-401b-b0cf-0123a7b62df6 -&gt; sda1
/dev/disk/by-uuid/5d2f85fe-b555-4504-a87f-3d1c6513c7d4 -&gt; sda2
/dev/disk/by-uuid/8b19014d-442a-4e2e-8367-569f000afaa0 -&gt; sda3
/dev/disk/by-uuid/678e905f-68cc-449e-99a9-cb90d7011d23 -&gt; sdb1
/dev/disk/by-uuid/687aa5e4-3863-4529-a8bf-fa526716f523 -&gt; sdb2</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo blkid
/dev/loop0: TYPE=&quot;squashfs&quot; 
/dev/sda1: UUID=&quot;8252dada-3e65-401b-b0cf-0123a7b62df6&quot; TYPE=&quot;ext4&quot; 
/dev/sda2: UUID=&quot;5d2f85fe-b555-4504-a87f-3d1c6513c7d4&quot; TYPE=&quot;swap&quot; 
/dev/sda3: UUID=&quot;8b19014d-442a-4e2e-8367-569f000afaa0&quot; TYPE=&quot;ext4&quot; 
/dev/sdb1: UUID=&quot;678e905f-68cc-449e-99a9-cb90d7011d23&quot; TYPE=&quot;ext4&quot; 
/dev/sdb2: LABEL=&quot;home-rw&quot; UUID=&quot;687aa5e4-3863-4529-a8bf-fa526716f523&quot; TYPE=&quot;ext4&quot;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo blkid -o list
device               fs_type   label       mount point       UUID
-------------------------------------------------------------------------------------------------
/dev/loop0           squashfs              (in use)                                                              
/dev/sda1            ext4                  (not mounted)     8252dada-3e65-401b-b0cf-0123a7b62df6
/dev/sda2            swap                  (not mounted)     5d2f85fe-b555-4504-a87f-3d1c6513c7d4
/dev/sda3            ext4                  /media/disk-1     8b19014d-442a-4e2e-8367-569f000afaa0
/dev/sdb1            ext4                  (not mounted)     678e905f-68cc-449e-99a9-cb90d7011d23
/dev/sdb2            ext4       home-rw    /home             687aa5e4-3863-4529-a8bf-fa526716f523</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ cat /dev/.blkid.tab                                                                                                 
&lt;device DEVNO=&quot;0x0700&quot; TIME=&quot;1336670951.551604&quot; TYPE=&quot;squashfs&quot;&gt;/dev/loop0&lt;/device&gt;                                                                                                             
&lt;device DEVNO=&quot;0x0801&quot; TIME=&quot;1336671278.523695&quot; UUID=&quot;8252dada-3e65-401b-b0cf-0123a7b62df6&quot; TYPE=&quot;ext4&quot;&gt;/dev/sda1&lt;/device&gt;                                                                      
&lt;device DEVNO=&quot;0x0802&quot; TIME=&quot;1336670951.552155&quot; UUID=&quot;5d2f85fe-b555-4504-a87f-3d1c6513c7d4&quot; TYPE=&quot;swap&quot;&gt;/dev/sda2&lt;/device&gt;                                                                      
&lt;device DEVNO=&quot;0x0803&quot; TIME=&quot;1336670951.552241&quot; UUID=&quot;8b19014d-442a-4e2e-8367-569f000afaa0&quot; TYPE=&quot;ext4&quot;&gt;/dev/sda3&lt;/device&gt;                                                                      
&lt;device DEVNO=&quot;0x0811&quot; TIME=&quot;1336670951.568408&quot; UUID=&quot;678e905f-68cc-449e-99a9-cb90d7011d23&quot; TYPE=&quot;ext4&quot;&gt;/dev/sdb1&lt;/device&gt;
&lt;device DEVNO=&quot;0x0812&quot; TIME=&quot;1336670951.568610&quot; LABEL=&quot;home-rw&quot; UUID=&quot;687aa5e4-3863-4529-a8bf-fa526716f523&quot; TYPE=&quot;ext4&quot;&gt;/dev/sdb2&lt;/device&gt;</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ cat /dev/.blkid.tab | sed 's/.*UUID=&quot;\(.*\)&quot;\ .*&gt;\(.*\)&lt;.*/\1 -&gt; \2/g' | grep -v ^\&lt; | sort -k2
8252dada-3e65-401b-b0cf-0123a7b62df6 -&gt; /dev/sda1
5d2f85fe-b555-4504-a87f-3d1c6513c7d4 -&gt; /dev/sda2
8b19014d-442a-4e2e-8367-569f000afaa0 -&gt; /dev/sda3
678e905f-68cc-449e-99a9-cb90d7011d23 -&gt; /dev/sdb1
687aa5e4-3863-4529-a8bf-fa526716f523 -&gt; /dev/sdb2</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo tune2fs -l /dev/sda1 | grep UUID | tail -c 37
8252dada-3e65-401b-b0cf-0123a7b62df6</pre></div></div>

<p>To change device UUID use <em>tune2fs</em> and <em>uuidgen</em> commands together:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo tune2fs -U `uuidgen` /dev/sda3</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/05/10/how-to-get-disk-uuid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to mount software RAID1 member using mdadm</title>
		<link>http://blog.sleeplessbeastie.eu/2012/05/08/how-to-mount-software-raid1-member-using-mdadm/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/05/08/how-to-mount-software-raid1-member-using-mdadm/#comments</comments>
		<pubDate>Tue, 08 May 2012 19:20:41 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=453</guid>
		<description><![CDATA[Just a moment ago I connected my old hard drive and realized that it was RAID member: $ sudo fdisk -l /dev/sdd Disk /dev/sdd: 250.1 GB, 250058268160 bytes 255 heads, 63 sectors/track, 30401 cylinders, total 488395055 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes [...]]]></description>
			<content:encoded><![CDATA[<p>Just a moment ago I connected my old hard drive and realized that it was RAID member:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo fdisk -l /dev/sdd
Disk /dev/sdd: 250.1 GB, 250058268160 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488395055 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
Disk identifier: 0x90909090
&nbsp;
   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *        2048     2099199     1048576   fd  Linux raid autodetect
/dev/sdd2         2099200     6293503     2097152   82  Linux swap / Solaris
/dev/sdd3         6293504    69208063    31457280   fd  Linux raid autodetect
/dev/sdd4        69208064   488394751   209593344   fd  Linux raid autodetect</pre></div></div>

<p>I couldn&#8217;t mount it out of the box:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo mkdir /mnt/old_hdd 
$ sudo mount /dev/sdd4 /mnt/old_hdd 
mount: unknown filesystem type 'linux_raid_member'</pre></div></div>

<p>Fortunately I used RAID1 array:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo mdadm --examine /dev/sdd4
/dev/sdd4:
          Magic : a92b4efc
        Version : 1.2
    Feature Map : 0x0
     Array UUID : 957e7cb5:bfd41f70:9cb84b0d:f53e5a4c
           Name : milosz-desktop:2
  Creation Time : Sat Aug 20 18:48:26 2011
     Raid Level : raid1
   Raid Devices : 2
&nbsp;
 Avail Dev Size : 419184640 (199.88 GiB 214.62 GB)
     Array Size : 419184496 (199.88 GiB 214.62 GB)
  Used Dev Size : 419184496 (199.88 GiB 214.62 GB)
    Data Offset : 2048 sectors
   Super Offset : 8 sectors
          State : clean
    Device UUID : db8a694f:750a0ded:22a6d046:5c4db280
&nbsp;
    Update Time : Tue May  8 20:50:32 2012
       Checksum : 75dbc3b6 - correct
         Events : 191
&nbsp;
&nbsp;
   Device Role : Active device 1
   Array State : .A ('A' == active, '.' == missing)</pre></div></div>

<p>I needed to create <em>md</em> virtual device using <em>mdadm</em>:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo mdadm -A -R /dev/md9 /dev/sdd4
mdadm: /dev/md9 has been started with 1 drive (out of 2).</pre></div></div>

<p>So it could be mounted without hassle:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo mount /dev/md9 /mnt/old_hdd/
$ mount | grep ^/dev/md9
/dev/md9 on /mnt/old_hdd type ext4 (rw)</pre></div></div>

<p>After data was moved I unmounted file system and removed <em>md</em> virtual device.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo umount /mnt/old_hdd 
$ sudo mdadm -S /dev/md9
mdadm: stopped /dev/md9</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/05/08/how-to-mount-software-raid1-member-using-mdadm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu &#8211; Boot to RAM &#8211; Couple of notes</title>
		<link>http://blog.sleeplessbeastie.eu/2012/05/02/ubuntu-boot-to-ram-couple-of-notes/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/05/02/ubuntu-boot-to-ram-couple-of-notes/#comments</comments>
		<pubDate>Wed, 02 May 2012 12:09:02 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=451</guid>
		<description><![CDATA[This post contains couple of notes on this topic in form of very short guide. Requirements VirtualBox Ubuntu Minimal CD First step &#8211; create virtual machine Create new virtual machine using VirtualBox and install minimal Ubuntu OS. Second step &#8211; install required packages Install squashfs-tools package so you can create squashfs image later: $ sudo [...]]]></description>
			<content:encoded><![CDATA[<p>This post contains couple of notes on this topic in form of very short guide.</p>
<p><strong>Requirements</strong></p>
<ul>
<li><a href="https://www.virtualbox.org/" title="VirtualBox">VirtualBox</a></li>
<li><a href="http://help.ubuntu.com/community/Installation/MinimalCD" title="Ubuntu Minimal CD">Ubuntu Minimal CD</a></li>
</ul>
<p><br/></p>
<p><strong>First step &#8211; create virtual machine</strong><br />
Create new virtual machine using VirtualBox and install minimal Ubuntu OS.<br />
<br/></p>
<p><strong>Second step &#8211; install required packages</strong><br />
Install <em>squashfs-tools</em> package so you can create squashfs image later:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo apt-get install squashfs-tools</pre></div></div>

<p>Install <em>live-boot</em> package with dependencies (<em>live-boot-initramfs-tools</em>) so you can use boot to ram:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo apt-get install live-boot</pre></div></div>

<p><br/></p>
<p><strong>Third step &#8211; prepare image contents</strong><br />
Create new directory and copy root file system contents:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo mkdir /squashfs</pre></div></div>

<p>You need to exclude contents of directory <em>/live</em> and one created just moment ago.<br />
You can also exclude contents of directories like <em>/boot/*</em>, <em>/tmp/*</em>, &#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo rsync -a --delete --one-file-system / /squashfs \
    --exclude=/live --exclude=/squashfs</pre></div></div>

<p>It&#8217;s good idea to remove root file system from <em>/squashfs/etc/fstab</em> file now.<br />
<br/></p>
<p><strong>Fourth step &#8211; create squashfs image</strong><br />
Create <em>/live</em> directory (squashfs image will be stored here):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo mkdir /live</pre></div></div>

<p>Create squashfs image:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo mksquashfs /squashfs /live/livefs.squashfs -noappend -always-use-fragments</pre></div></div>

<p><br/></p>
<p><strong>Fifth step &#8211; configure grub2</strong><br />
Change <em>GRUB_TIMEOUT</em> to <em>-1</em> in <em>/etc/defaults/grub</em> so it will be waiting forever in boot menu.</p>
<p>Update grub configuration:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo update-grub</pre></div></div>

<p>Check your kernel release:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ uname -r
3.0.0-17-generic</pre></div></div>

<p>Edit <em>/etc/grub.d/40_custom</em> file to add new entry in grub2 menu and take into account your kernel release:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">menuentry &quot;Live minimal OS&quot; {
 set root='(hd0,1)'
 linux /boot/vmlinuz-3.2.0-24-generic boot=live toram=livefs.squashfs
 initrd /boot/initrd.img-3.2.0-24-generic
}</pre></div></div>

<p>Update grub configuration again:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo update-grub</pre></div></div>

<p><br/></p>
<p><strong>Sixth step &#8211; check it out!</strong><br />
Reboot system and check it out:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo reboot</pre></div></div>

<p><br/></p>
<p><strong>Couple of notes</strong><br />
Compression is very effective as it can compress 2 GB file system (KDE + Libre Office + couple of smaller applications) to around 700 MB.</p>
<p>System becomes blazingly fast and you can easily create live usb this way.</p>
<p>To make your changes persistent just create partitions labelled accordingly <em>live-rw</em> for root, <em>home-rw</em> for home file system and add <em>persistent</em> parameter to kernel boot parameters. If you can&#8217;t create new partitions then create files in root directory (not in live fs). For example to create persistent home (200MB, without reserved blocks) use commands:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo dd if=/dev/zero of=/home-rw bs=1M count=200
$ sudo mkfs.ext4 /home-rw
$ sudo tune2fs -m 0 /home-rw
$ sudo tune2fs -L home-rw /home-rw</pre></div></div>

<p>Apparmor doesn&#8217;t work very well so you need to remove it.</p>
<p>To see how it works go to directory <em>/usr/share/initramfs-tools/scripts</em> and start with reading <em>live</em> file. After any modifications don&#8217;t forget to update initramfs:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ sudo update-initramfs -u</pre></div></div>

<p>Don&#8217;t forget to read <em>live-boot</em> manual page.<br />
<br/></p>
<p><strong>Couple of common errors</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">only one RO file system supported with exposedroot</pre></div></div>

<p>Just remove <em>livefs.squashfs</em> file from <em>/squashfs/live/</em> directory and create squashfs image again.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">a wrong rootfs was mounted</pre></div></div>

<p>This error means that <em>live-boot</em> package was not installed on system that was used to create squashfs image. Just install it and create image again.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/05/02/ubuntu-boot-to-ram-couple-of-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu &#8211; How to add custom grub entry?</title>
		<link>http://blog.sleeplessbeastie.eu/2012/05/01/ubuntu-how-to-add-custom-grub-entry/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/05/01/ubuntu-how-to-add-custom-grub-entry/#comments</comments>
		<pubDate>Tue, 01 May 2012 14:43:06 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=449</guid>
		<description><![CDATA[Edit /etc/grub.d/40_custom file to add custom entry in grub2 menu (this is just an example): menuentry &#34;Live&#34; { set root='(hd0,1)' linux /boot/vmlinuz-3.2.0-24-generic boot=live toram=fs.squashfs initrd /boot/initrd.img-3.2.0-24-generic } After applying changes update grub configuration: # update-grub To print kernel release use uname command: $ uname -r 3.2.0-24-generic]]></description>
			<content:encoded><![CDATA[<p>Edit <em>/etc/grub.d/40_custom</em> file to add custom entry in grub2 menu (this is just an example):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">menuentry &quot;Live&quot; {
 set root='(hd0,1)'
 linux /boot/vmlinuz-3.2.0-24-generic boot=live toram=fs.squashfs
 initrd /boot/initrd.img-3.2.0-24-generic
}</pre></div></div>

<p>After applying changes update grub configuration:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># update-grub</pre></div></div>

<p>To print kernel release use <em>uname</em> command:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$ uname -r
3.2.0-24-generic</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/05/01/ubuntu-how-to-add-custom-grub-entry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu &#8211; Where to download Minimal CD?</title>
		<link>http://blog.sleeplessbeastie.eu/2012/05/01/ubuntu-where-to-download-minimal-cd/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/05/01/ubuntu-where-to-download-minimal-cd/#comments</comments>
		<pubDate>Tue, 01 May 2012 14:25:23 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=448</guid>
		<description><![CDATA[Recently I started to use Minimal CD for customized installation so I need to write down places where I can get it. Minimal CD can be downloaded at help.ubuntu.com/community/Installation/MinimalCD. Actually official site doesn&#8217;t contain version 12.04 yet but it can be directly downloaded for i386 and amd64 versions.]]></description>
			<content:encoded><![CDATA[<p>Recently I started to use Minimal CD for customized installation so I need to write down places where I can get it.</p>
<p>Minimal CD can be downloaded at <a href="http://help.ubuntu.com/community/Installation/MinimalCD" title="Minimal CD">help.ubuntu.com/community/Installation/MinimalCD</a>.</p>
<p>Actually official site doesn&#8217;t contain version 12.04 yet but it can be directly downloaded for <a href=" http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-i386/current/images/netboot/mini.iso" title="Minimal CD i386">i386</a> and <a href="http://archive.ubuntu.com/ubuntu/dists/precise/main/installer-amd64/current/images/netboot/mini.iso" title="Minimal CD amd64">amd64</a> versions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/05/01/ubuntu-where-to-download-minimal-cd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to check the progress of dd</title>
		<link>http://blog.sleeplessbeastie.eu/2012/04/29/how-to-check-the-progress-of-dd/</link>
		<comments>http://blog.sleeplessbeastie.eu/2012/04/29/how-to-check-the-progress-of-dd/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 20:06:53 +0000</pubDate>
		<dc:creator>milosz</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sleeplessbeastie.eu/?p=390</guid>
		<description><![CDATA[To check the progress of dd execute command: # kill -USR1 `pgrep -u \`whoami\` ^dd` This command will send USR1 signal to every dd process owned by user. When dd process receives USR1 signal it will print overall progress: # dd if=/dev/sdb of=./sdb.raw 133345+0 records in 133344+0 records out 68272128 bytes (68 MB) copied, 3.00926 [...]]]></description>
			<content:encoded><![CDATA[<p>To check the progress of <em>dd</em> execute command:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># kill -USR1 `pgrep -u \`whoami\` ^dd`</pre></div></div>

<p>This command will send <em>USR1</em> signal to every <em>dd</em> process owned by user.</p>
<p>When <em>dd</em> process receives <em>USR1</em> signal it will print overall progress:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># dd if=/dev/sdb of=./sdb.raw
133345+0 records in
133344+0 records out
68272128 bytes (68 MB) copied, 3.00926 s, 22.7 MB/s
...
15244673+0 records in
15244673+0 records out
7805272576 bytes (7,8 GB) copied, 2511,34 s, 3,1 MB/s
...</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.sleeplessbeastie.eu/2012/04/29/how-to-check-the-progress-of-dd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

