Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:guide-user:installation:installation_methods:sd_card [2021/06/16 19:37] – added FS resize info to sd card install frollic | docs:guide-user:installation:installation_methods:sd_card [2024/02/12 12:06] – external edit | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| Installation can be done via SD card. | Installation can be done via SD card. | ||
| - | FIXME //Provide an outline of the procedure here// | ||
| ===== Prebuilt disk images ===== | ===== Prebuilt disk images ===== | ||
| Line 10: | Line 9: | ||
| ==== General procedure: ==== | ==== General procedure: ==== | ||
| + | **Linux :** | ||
| - Download the correct image for your device. Probably named similar to '' | - Download the correct image for your device. Probably named similar to '' | ||
| - Decompress it: < | - Decompress it: < | ||
| - | - Connect | + | - Connect |
| - | - Double check that you have identified your sdcard | + | - Double check that you have identified your sd card correctly. If the ''/ |
| - | - copy the image to the sdcard | + | - copy the image to the sd card with: < |
| + | |||
| + | **Other OS :** \\ | ||
| + | |||
| + | https:// | ||
| + | - Download the correct image for your device. Probably named similar to '' | ||
| + | - Select the image. | ||
| + | - Select your SD card. | ||
| + | - Flash the image. | ||
| Examples: | Examples: | ||
| - | * [[toh: | ||
| * [[toh: | * [[toh: | ||
| - | * [[docs:techref:hardware:soc: | + | * [[:toh:friendlyarm:nanopi_r4s_v1#installation|R4S]] |
| ==== Which image to chose? ==== | ==== Which image to chose? ==== | ||
| - | Often, different | + | Often a device has multiple |
| === ext4-sdcard.img.gz === | === ext4-sdcard.img.gz === | ||
| - | * not optimized for flash memory (journaling | + | * not optimized for flash memory (journaling |
| - | * sdcard | + | * sd card can be easily |
| - | * desktop linux standard | + | * updates and changes can be made directly to the partition |
| - | * | + | * Linux desktop standard |
| === squashfs-sdcard.img.gz === | === squashfs-sdcard.img.gz === | ||
| - | * newer images include a hidden f2fs filesystem, which is optimized for flash memory | ||
| * compressed | * compressed | ||
| - | * needs special mount procedure, to externally modify | + | |
| + | | ||
| * all changes are done in an overlay partition | * all changes are done in an overlay partition | ||
| + | * due to overlay partition it is simple to reset system to defaults | ||
| == other images == | == other images == | ||
| * ubifs-sdcard.img.gz | * ubifs-sdcard.img.gz | ||
| - | * ... | ||
| - | == see also == | + | ==== Mounting a squashfs filesystem locally ==== |
| + | If you insert your newly flashed SD card into a Linux machine, it will be easy to mount the read only squashfs partition but it won't know about the overlay, which is not even in the partition table but instead located immediately after the squashfs filesystem in the same partition. You therefore need to mount the overlay as a loopback device. You can discover the offset by running losetup on the device, or calculate the offset yourself by inspecting the filesystem. | ||
| + | |||
| + | < | ||
| + | # Setup the loop back device. | ||
| + | # See libfstools/ | ||
| + | DEVICE= ### Set this appropriately - e.g. /dev/sda | ||
| + | PARTITION=" | ||
| + | FS_SIZE=" | ||
| + | FS_OFFSET=" | ||
| + | LOOP_DEVICE=" | ||
| + | |||
| + | # Now mount both partitions (remember, you may need to unmount any automatic mounts) | ||
| + | mkdir -p /mnt/base / | ||
| + | sudo mount " | ||
| + | sudo mount " | ||
| + | sudo mount -o noatime, | ||
| + | </ | ||
| + | |||
| + | This should leave you with a writable filesystem in / | ||
| ==== Expanding the filesystem ==== | ==== Expanding the filesystem ==== | ||
| + | |||
| To use the whole available space of your sdcard, you probably have to resize your partition. | To use the whole available space of your sdcard, you probably have to resize your partition. | ||
| + | |||
| === squashfs image === | === squashfs image === | ||
| - | To resize the squashfs-image one has to know the offset of the hidden f2fs filesystem. | ||
| - | In this example, the squashfs partiton is ''/ | ||
| - | - You can find the offset, by running '' | ||
| - | - On your computer, resize the squashfs partition, for example with '' | ||
| - | - Loop mount the underlying f2fs partition (( If you are already using a loop device, you may have to use another number that loop0 )) < | ||
| - | - Run filesystem checks < | ||
| - | - Resize f2fs filesystem < | ||
| - | Now your filesystem should be recognized with the correct size. | ||
| + | As with mounting the overlay above, to resize it you'll need the offset of the hidden f2fs or ext4 filesystem (depending on the size of your image, one or the other will be used). | ||
| + | |||
| + | First, make sure the partition is not mounted, then do something like: | ||
| + | |||
| + | < | ||
| + | DEVICE= ### Set this appropriately - e.g. /dev/sda | ||
| + | PARTITION=" | ||
| + | sudo cfdisk " | ||
| + | |||
| + | # Create a loop device pointing to the FS | ||
| + | # See libfstools/ | ||
| + | FS_SIZE=" | ||
| + | FS_OFFSET=" | ||
| + | LOOP_DEVICE=" | ||
| + | |||
| + | # Now, resize... you may need to fsck first, though. | ||
| + | sudo fsck " | ||
| + | sudo resize2fs " | ||
| + | </ | ||
| === ext4 image === | === ext4 image === | ||
| - | You can us gparted to resize and extend the partitions. | ||
| - | To do it online, follow the procedure in [[http:// | ||
| + | You can use gparted to resize and extend the partitions. | ||
| + | To do it online, follow the procedure in [[http:// | ||
| + | |||
| + | Example, to resize ''/ | ||
| + | < | ||
| + | parted | ||
| + | p | ||
| + | resizepart 2 32GB | ||
| + | q | ||
| + | </ | ||
| + | Next, you may need to repair your device (perhaps say yes to all interactive queries): | ||
| < | < | ||
| mount -o remount,ro / #Remount root as Read Only | mount -o remount,ro / #Remount root as Read Only | ||
| - | tune2fs -O^resize_inode /dev/device | + | tune2fs -O^resize_inode /dev/mmcblk0p2 |
| - | fsck.ext4 /dev/device | + | fsck.ext4 /dev/mmcblk0p2 |
| - | + | </ | |
| - | #reboot | + | Now, '' |
| - | resize2fs /dev/device | + | < |
| + | resize2fs /dev/mmcblk0p2 | ||
| </ | </ | ||
| Line 80: | Line 130: | ||
| ===== Devices with this installation method ===== | ===== Devices with this installation method ===== | ||
| - | ---- datatable ---- | + | <!-- ToH: { |
| - | cols : Brand, Model, Versions, Supported Current Rel_releasecurrent, Installation method(s)_method-installations, Comment installation, Device Page_page, Device Techdata_pageid | + | " |
| - | dynfilters | + | " |
| - | filter | + | " |
| - | filter | + | " |
| - | sort : Brand | + | " |
| - | limit : 25 | + | " |
| - | ---- | + | } --> |