<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.52pi.com/index.php?action=history&amp;feed=atom&amp;title=Linux</id>
	<title>Linux - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.52pi.com/index.php?action=history&amp;feed=atom&amp;title=Linux"/>
	<link rel="alternate" type="text/html" href="https://wiki.52pi.com/index.php?title=Linux&amp;action=history"/>
	<updated>2026-10-20T06:28:49Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://wiki.52pi.com/index.php?title=Linux&amp;diff=3293&amp;oldid=prev</id>
		<title>Yoyojacky: Created page with &quot;==INSTALLING OPERATING SYSTEM IMAGES ON LINUX== Etcher is typically the easiest option for most users to write images to SD cards, so it is a good place to start.&lt;br&gt; If you&#039;r...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.52pi.com/index.php?title=Linux&amp;diff=3293&amp;oldid=prev"/>
		<updated>2018-03-01T05:24:58Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;==INSTALLING OPERATING SYSTEM IMAGES ON LINUX== Etcher is typically the easiest option for most users to write images to SD cards, so it is a good place to start.&amp;lt;br&amp;gt; If you&amp;#039;r...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==INSTALLING OPERATING SYSTEM IMAGES ON LINUX==&lt;br /&gt;
Etcher is typically the easiest option for most users to write images to SD cards, so it is a good place to start.&amp;lt;br&amp;gt;&lt;br /&gt;
If you&amp;#039;re looking for more advanced options on Linux, you can use the standard command line tools below.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Note: use of the dd tool can overwrite any partition of your machine. &lt;br /&gt;
If you specify the wrong device in the instructions below, you could delete your primary Linux partition. &lt;br /&gt;
Please be careful.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==DISCOVERING THE SD CARD MOUNT POINT AND UNMOUNTING IT==&lt;br /&gt;
* Run lsblk to see which devices are currently connected to your machine.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
If your computer has a slot for SD cards, insert the card. &lt;br /&gt;
If not, insert the card into an SD card reader, then connect the reader to your computer.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Run lsblk again. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
The new device that has appeared is your SD card (you can also usually tell from the listed device size). &lt;br /&gt;
The naming of the device will follow the format described in the next paragraph.&lt;br /&gt;
The left column of the results from the lsblk command gives the device name of your SD card &lt;br /&gt;
and the names of any partitions on it (usually only one, but there may be several if the card was previously used).&lt;br /&gt;
It will be listed as something like /dev/mmcblk0 or /dev/sdX (with partition names  /dev/mmcblk0p1 or /dev/sdX1 respectively), &lt;br /&gt;
where X is a lower-case letter indicating the device (eg. /dev/sdb1). &lt;br /&gt;
The right column shows where the partitions have been mounted (if they haven&amp;#039;t been, it will be blank).&lt;br /&gt;
&lt;br /&gt;
If any partitions on the SD card have been mounted, unmount them all with  umount, &lt;br /&gt;
for example umount /dev/sdX1 (replace sdX1 with your SD card&amp;#039;s device name, and change the number for any other partitions).&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==COPYING THE IMAGE TO THE SD CARD==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
In a terminal window, write the image to the card with the command below, &lt;br /&gt;
making sure you replace the input file if= argument with the path to your  .img file, &lt;br /&gt;
and the /dev/sdX in the output file of= argument with the correct device name. &lt;br /&gt;
This is very important, as you will lose all the data on the hard drive if you provide the wrong device name. &lt;br /&gt;
Make sure the device name is the name of the whole SD card as described above, not just a partition. &lt;br /&gt;
For example: sdd, not sdds1 or sddp1; mmcblk0, not  mmcblk0p1.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* dd bs=4M if=2017-11-29-raspbian-stretch.img of=/dev/sdX conv=fsync&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Please note that block size set to 4M will work most of the time. &lt;br /&gt;
If not, try  1M, although this will take considerably longer.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Also note that if you are not logged in as root you will need to prefix this with  sudo.&lt;br /&gt;
==COPYING A ZIPPED IMAGE TO THE SD CARD==&lt;br /&gt;
In Linux it is possible to combine the unzip and SD copying process into one command, &amp;lt;br&amp;gt;&lt;br /&gt;
which avoids any issues that might occur when the unzipped image is larger than 4GB. &amp;lt;br&amp;gt;&lt;br /&gt;
This can happen on certain filesystems that do not support files larger than 4GB (e.g. FAT), &amp;lt;br&amp;gt;&lt;br /&gt;
although it should be noted that most Linux installations do not use FAT and therefore do not have this limitation.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following command unzips the zip file (replace 2017-11-29-raspbian-stretch.zip with the appropriate zip filename),&amp;lt;br&amp;gt;&lt;br /&gt;
and pipes the output directly to the dd command. &amp;lt;br&amp;gt;&lt;br /&gt;
This in turn copies it to the SD card, as described in the previous section.&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
unzip -p 2017-11-29-raspbian-stretch.zip | sudo dd of=/dev/sdX bs=4M conv=fsync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==CHECKING THE IMAGE COPY PROGRESS==&lt;br /&gt;
By default, the dd command does not give any information about its progress, so it may appear to have frozen.&amp;lt;br&amp;gt;&lt;br /&gt;
It can take more than five minutes to finish writing to the card. &amp;lt;br&amp;gt;&lt;br /&gt;
If your card reader has an LED, it may blink during the write process.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To see the progress of the copy operation, you can run the dd command with the status option.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd bs=4M if=2017-11-29-raspbian-stretch.img of=/dev/sdX status=progress conv=fsync&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you are using an older version of dd, the status option may not be available.&amp;lt;br&amp;gt;&lt;br /&gt;
You may be able to use the dcfldd command instead, which will give a progress report showing how much has been written.&amp;lt;br&amp;gt;&lt;br /&gt;
Another method is to send a USR1 signal to dd, which will let it print status information. &amp;lt;br&amp;gt;&lt;br /&gt;
Find out the PID of dd by using &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pgrep -l dd or ps a | grep dd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then use&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
kill -USR1 PID &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
to send the USR1 signal to dd.&lt;br /&gt;
==CHECKING WHETHER THE IMAGE WAS CORRECTLY WRITTEN TO THE SD CARD==&lt;br /&gt;
After dd has finished copying, you can check what has been written to the SD card by dd-ing from the card back to another image on your hard disk;&amp;lt;br&amp;gt;&lt;br /&gt;
truncating the new image to the same size as the original;&amp;lt;br&amp;gt;&lt;br /&gt;
 and then running  diff (or md5sum) on those two images.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the SD card is bigger than the original image size, dd will make a copy of the whole card.&amp;lt;br&amp;gt;&lt;br /&gt;
We must therefore truncate the new image to the size of the original image. &amp;lt;br&amp;gt;&lt;br /&gt;
Make sure you replace the input file if= argument with the correct device name.&amp;lt;br&amp;gt;&lt;br /&gt;
diff should report that the files are identical.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dd bs=4M if=/dev/sdX of=from-sd-card.img&lt;br /&gt;
truncate --reference 2017-11-29-raspbian-stretch.img from-sd-card.img&lt;br /&gt;
diff -s from-sd-card.img 2017-11-29-raspbian-stretch.img&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Run sync. This will ensure the write cache is flushed and that it is safe to unmount your SD card.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Remove the SD card from the card reader.&amp;lt;br&amp;gt;&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Yoyojacky</name></author>
	</entry>
</feed>