<?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>Linux System Administration and Security &#187; Uncategorized</title>
	<atom:link href="http://www.jasonbrown.us/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jasonbrown.us</link>
	<description></description>
	<lastBuildDate>Tue, 31 Jan 2012 02:58:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Mounting a USB device in a Xen Guest</title>
		<link>http://www.jasonbrown.us/2012/01/mounting-usb-device-xen-guest/</link>
		<comments>http://www.jasonbrown.us/2012/01/mounting-usb-device-xen-guest/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 00:55:42 +0000</pubDate>
		<dc:creator>jason</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Dom0]]></category>
		<category><![CDATA[DomU]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[Xen]]></category>

		<guid isPermaLink="false">http://www.jasonbrown.us/?p=194</guid>
		<description><![CDATA[Mounting a USB device Attach the USB device to the Dom0 and run &#8216;dmesg&#8217; to see if the device attached Run &#8216;fdisk -l&#8217; to see if the drive is partitioned the way you want it For instance: [root@example ~]# fdisk -l /dev/sdc Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders Units ]]></description>
			<content:encoded><![CDATA[<p><strong>Mounting a USB device</strong></p>
<ol>
<li>Attach the USB device to the Dom0 and run &#8216;dmesg&#8217; to see if the device attached</li>
<li>Run &#8216;fdisk -l&#8217; to see if the drive is partitioned the way you want it</li>
<li>For instance:<br />
[root@example ~]# fdisk -l /dev/sdc<br />
Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes<br />
255 heads, 63 sectors/track, 121601 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
Device Boot Start End Blocks Id System<br />
dev/sdc1 1 121601 976760001 8e Linux LVM</li>
<li>Now find a drive letter that is not being used on the DomU, in this instance we&#8217;ll use /dev/sde</li>
<li>To attach the USB device to the DomU run the following command
<ul>
<li>xm block-attach exampledomu phy:/dev/sdc sde w</li>
</ul>
</li>
<li>You should now see the device on the DomU, run either &#8216;dmesg&#8217; or &#8216;fdisk -l&#8217; to verify</li>
<li>Mount the device as normal
<ul>
<li>mount /dev/sde1 /mnt/usb</li>
</ul>
</li>
</ol>
<p><strong>Unmounting the device</strong></p>
<ol>
<li>You first need to get the device id number from the block list. Do this by running:
<ul>
<li>xm block-list exampledomu</li>
</ul>
</li>
<li>This will return:<br />
Vdev BE handle state evt-ch ring-ref BE-path<br />
51712 0 0 4 9 8 /local/domain/0/backend/tap/23/51712<br />
2176 0 0 4 10 1338 /local/domain/0/backend/vbd/23/2176</li>
<li>The number you need to use to remove the device is 2176</li>
<li>Unmount the USB device from the DomU
<ul>
<li>umount /mnt/usb</li>
</ul>
</li>
<li>Now on the Dom0 run:</li>
<li>xm block-detach exampledomu 2176</li>
<li>You may now remove the USB device</li>
</ol>
<div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=Mounting+a+USB+device+in+a+Xen+Guest+http%3A%2F%2Fjasonbrown.us%2F%3Fp%3D194" title="Post to Twitter"><img class="nothumb" src="http://www.jasonbrown.us/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.jasonbrown.us/2012/01/mounting-usb-device-xen-guest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

