<?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>Work Arounds &#8211; bhzhuOS爱好者(原StartOS爱好者)</title>
	<atom:link href="https://www.bhzhu203.com/tag/work-arounds/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.bhzhu203.com</link>
	<description>QQ群号125732839</description>
	<lastBuildDate>Thu, 28 Apr 2016 07:50:54 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.7</generator>
	<item>
		<title>chroot to update grub</title>
		<link>https://www.bhzhu203.com/2016/04/28/chroot-to-update-grub/</link>
		
		<dc:creator><![CDATA[bhzhu203]]></dc:creator>
		<pubDate>Thu, 28 Apr 2016 07:50:54 +0000</pubDate>
				<category><![CDATA[linux知识]]></category>
		<category><![CDATA[Work Arounds]]></category>
		<guid isPermaLink="false">http://www.bhzhu203.com/?p=198</guid>

					<description><![CDATA[grub-probe: error: cannot find a device  [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>grub-probe: error: cannot find a device for / (is /dev mounted?)</p>
<p>This problem is most often seen during an apt-get update or similar.<br />
Issues in chroot</p>
<p>Mostly this is caused by some issues when running in a chroot. Before switching to the chroot, it&#8217;s necessary to mount at least the /dev and /proc directories. However sometimes we&#8217;ve seen this issue even with these mounts properly configured.</p>
<p>In this example vm1 represens the device our system is running on; it could as easily have been /dev/sda1 or /dev/sdx4.</p>
<p>~ # mount /dev/vg0/vm1 /mnt/vm1<br />
~ # mount -o bind /dev /mnt/vm1/dev<br />
~ # mount -o bind /dev/pts /mnt/vm1/dev/pts<br />
~ # mount -o bind /proc /mnt/vm1/proc<br />
~ # mount -o bind /run /mnt/vm1/run<br />
~ # mount -o bind /sys /mnt/vm1/sys<br />
~ # chroot /mnt/vm1 /bin/bash</p>
<p>Viewing grub-mkconfig Details</p>
<p>Run grub-mkconfig with debug spew to see details.</p>
<p>~ # sh -x /usr/sbin/grub-mkconfig -o /boot/grub/grub.cfg</p>
<p>Work Arounds</p>
<p>If grub-probe still fails for you, even if properly entering chroot there is one last-ditch work-around.</p>
<p>The purpose of grub-probe is to simply output the file-system type for /. So, in the worst case you can do this.</p>
<p>~ # mv /usr/sbin/grub-probe /usr/sbin/grub-probe.orig<br />
~ # curl edoceo.com/pub/grub-probe.sh &gt; /usr/sbin/grub-probe<br />
~ # chmod 0755 /usr/sbin/grub-probe</p>
<p>Here we effectively replace the binary grub-probe with a shell script that simply echos a known good value.<br />
Core of grub-probe</p>
<p>The grub-probe utility is a binary that does something like this.</p>
<p>Examine /proc/filesystems<br />
Examine /boot/grub/device.map<br />
Probe /dev/sd*<br />
Examine /proc/devices<br />
Examine /proc/self/mountinfo</p>
<p>From that information it will output the file-system type, device, file-system UUID which are fed to the grub-mkconfig</p>
<p>转自：http://edoceo.com/notabene/grub-probe-error-cannot-find-device-for-root</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
