{"id":1069,"date":"2024-02-12T08:23:53","date_gmt":"2024-02-12T08:23:53","guid":{"rendered":"https:\/\/bechele.de\/?page_id=1069"},"modified":"2024-02-12T08:23:54","modified_gmt":"2024-02-12T08:23:54","slug":"handling-sd-card-image-files","status":"publish","type":"page","link":"https:\/\/bechele.de\/?page_id=1069","title":{"rendered":"Handling SD card Image files"},"content":{"rendered":"\n<p class=\"has-vivid-cyan-blue-color has-text-color has-link-color has-medium-font-size wp-elements-5d9235b09761897d9d7f4c0b5d22231e\">SD card images may be downloaded here: <a href=\"https:\/\/my.hidrive.com\/share\/pc-obnpvxa\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/my.hidrive.com\/share\/pc-obnpvxa<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">General Notes about the provided SD card images.\n--------------------------------------------------------------\nAll Images are as small as possible. That means, usually they fit onto a relatively small SD card. To copy the image onto a SD card, you need some image writing software. On the other hand, the images have only little space left, so after writing the image to an SD card, you need to maximize the file system size to the maximum size of your SD card after installation.\n\nYoun need: \n---------------\n1. A SD card with a minimum size of at least  the size of the image file. \n2. SD card Adapter\/hardware so the SD card can be acessed by your Operating system.\n\nWriting a SD card image to a SD card on Linux: \n--------------------------------------------------------\n1. List the \/dev directory of your system without connected SD card\n2. Connect the SD card to the System\n3. List the \/dev directory again and compare for differences. \n4. Typically you see at least two additional devices for example: \/dev\/sdc, and eventually \/dev\/sdc1 and possibly \/dev\/sdc2 \n5. Make sure you found your sd card devices by disconnect the SD card again and check the \/dev again\n6. Once you are sure which are the devices of your SD card, you may write the image file to your SD card\n7. Use dd: dd if=&lt;Path to your SD card image file>  bs=1M of=&lt;major device you just found - for example \/dev\/sdc> status=progress :\n    So a real command could look like: \n    dd if=\/home\/data\/raspi3b_bechele_raspbian.img bs=2M of=\/dev\/sdc status=progress\n8. After writing the image, disconnect it from the adapter and put it into your mini computer.\n\nWriting a SD card on Windows:\n--------------------------------------\nHere you need a image software, such as Win32DiskImager. Please read the instructions for the imager software you use.\nBe careful: Windows tends to detect SD cards automatically and if recognized as unformatted, it will ask persistantly for formatting. \n!!!!!!  DO NOT FORMAT the SD CARD !!!!!!! The format comes along with the image. Also after writing, sometimes Windows tends to ask again, because the format on the SD is unknown to Windows.  !!!!!! Remove the card immediately after writing, otherwise you take risk Windows spoils ther content !!!!!!  (happened several times to me though I never answered the formatting question positively) \n\nBooting your mini computer (RASPI or OrangePI):\n------------------------------------------------------------\nAfter inserting the SD card, just power up your mini computer.\nIf you connected a LAN cable and you have a DHCP server in your network, the OS will aks for an IP address and you may afterwards connect via SSH directy from remote. (If you have a router, check with the router software, which IP has been given to the minicomputer) \nSince all of the provided images are prepared to work \"Headless\" means you do not need Monitor and keyboard, the SSH Daemon on the Minicomputer is already active.\nThough standard distributions do not do this any more for security reasons, I take the security risk as minimal, since practically all networks are protected by NAT or a fireWall. \nThe risk we have is, that if an attacker knows the default login and password for this system, he might login and install some backdoors quicker than you can to change the password and thererfore take over control. \nHowever if you are in doubt, do not connect a network initially, but connect keyboard and monitor and change the password after the first login. After that you are safe.\n\nLogin: rolf\nPassword: bechele\n\nCanging the password to somewhat more safe:\n----------------------------------------------------------\npasswd rolf - then follow the screen info  - This step is a must - if you omit, others may guess your login !!!\n\nChanging the file system size, so it uses the whole SD card space:\n--------------------------------------------------------------------------------\nThe Image for OrangePi-PC has only one file system on the SD ( that later takes the whole SD card), but the Raspi images contain two file systems, where the second takes later the rest of the SD card. \n1. check the existing file system(s): \n\ndf -h (orangePi)\nDateisystem    Gr\u00f6\u00dfe Benutzt Verf. Verw% Eingeh\u00e4ngt auf\nudev            427M       0  427M    0% \/dev\ntmpfs           100M    2,0M   98M    3% \/run\n>>>>> \/dev\/mmcblk0p1  2,2G    1,6G  621M   72% \/   &lt;&lt;&lt;&lt;&lt; the interesting one\ntmpfs           499M       0  499M    0% \/dev\/shm\ntmpfs           5,0M       0  5,0M    0% \/run\/lock\ntmpfs           499M       0  499M    0% \/tmp\n\/dev\/zram1       47M    3,2M   41M    8% \/var\/log\ntmpfs           100M       0  100M    0% \/run\/user\/1000\n\ndf -h (Raspberry Pi)\nFilesystem      Size  Used Avail Use% Mounted on\nudev            319M     0  319M   0% \/dev\ntmpfs            91M  988K   90M   2% \/run\n>>>>> \/dev\/mmcblk0p2  3.0G  2.3G  473M  84% \/   &lt;&lt;&lt;&lt;&lt; the interesting one\ntmpfs           455M     0  455M   0% \/dev\/shm\ntmpfs           5.0M   12K  5.0M   1% \/run\/lock\n\/dev\/mmcblk0p1  510M   61M  450M  12% \/boot\/firmware\ntmpfs            91M     0   91M   0% \/run\/user\/1000\n\nThe following steps need to be done with care !! - failing here may render the SD card unusable and might require to write the image again.\nAll subsequent steps require Administator (root) permission\n\nDeleting the Parition to extend (though we delete, the content remains):\nsudo fdisk \/dev\/mmcblk0\nThough we get a warning - we do not respect:\n\np   -print the partition table\n\nOn RaspberryPi:\nDevice         Boot   Start     End Sectors  Size Id Type\n\/dev\/mmcblk0p1         8192 1056767 1048576  512M  c W95 FAT32 (LBA)\n\/dev\/mmcblk0p2      1056768 7396684 6339917    3G 83 Linux\n\nNote the start number for  \/dev\/mmcblk0p2\n\nOn OrangePi:\nDevice         Boot Start     End Sectors  Size Id Type\n\/dev\/mmcblk0p1       8192 4738460 4730269  2,3G 83 Linux\n\nNote the start number for  \/dev\/mmcblk0p1\n\nd   -deletes a partition\nOn Orangepi you get the info \"Partition1 has been deleted\"\nOn RaspberryPi you will be asked \"Partition number (1,2, default 2):\" - just hit enter\n\n\nn   -creates a new partition\nPartition type\n   p   primary (1 primary, 0 extended, 3 free)\n   e   extended (container for logical partitions)\nSelect (default p):  - just hit enter\n\nPartition number (2-4, default 2):  - just hit enter (on Orangepi the default is 1)\n\nFirst sector (2048-61067263, default 2048): &lt; enter here the start number you noted before > (1056768 on a raspberryPi and 8192 on a OrangePi)\nLast sector, +\/-sectors or +\/-size{K,M,G,T,P} (1056768-61067263, default 61067263): just hit enter for the default\n\nCreated a new partition 2 of type 'Linux' and of size 28.6 GiB.  (of course this is depending on your SD card)\nPartition #2 contains a ext4 signature.\n\nDo you want to remove the signature? [Y]es\/[N]o: enter \"n\" (we don't want to delete the signature)\n\np    -to show the new partition table\n\nDevice         Boot   Start      End  Sectors  Size Id Type\n\/dev\/mmcblk0p1         8192  1056767  1048576  512M  c W95 FAT32 (LBA)\n\/dev\/mmcblk0p2      1056768 61067263 60010496 28.6G 83 Linux\n\nIf the start number of the changed partition is like before you may save with:\n\nw  -to write the new created partition table\n\nq  -to quit\n\nNow we are back in the command prompt and we might resize the file system (mmcblk0p2 on RasperryPi and mmcblk0p1 on Orangepi\n\nsudo resize2fs \/dev\/mmcblk0p2\nAt the end of the resizing it will tell you the new size.\n\nwith df -h you may see the new \"gained\" space.\n\nFilesystem      Size  Used Avail Use% Mounted on\nudev             82M     0   82M   0% \/dev\ntmpfs            43M  940K   42M   3% \/run\n\/dev\/mmcblk0p2   29G  2.3G   25G   9% \/\ntmpfs           215M     0  215M   0% \/dev\/shm\ntmpfs           5.0M   12K  5.0M   1% \/run\/lock\n\/dev\/mmcblk0p1  510M   93M  418M  19% \/boot\/firmware\ntmpfs            43M     0   43M   0% \/run\/user\/1000\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SD card images may be downloaded here: https:\/\/my.hidrive.com\/share\/pc-obnpvxa General Notes about the provided SD card images. &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; All Images are as small as possible. That&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":1060,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1069","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages\/1069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bechele.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1069"}],"version-history":[{"count":1,"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages\/1069\/revisions"}],"predecessor-version":[{"id":1070,"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages\/1069\/revisions\/1070"}],"up":[{"embeddable":true,"href":"https:\/\/bechele.de\/index.php?rest_route=\/wp\/v2\/pages\/1060"}],"wp:attachment":[{"href":"https:\/\/bechele.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}