From b4931aeef54507f4966d665bd8701c15b06ceb09 Mon Sep 17 00:00:00 2001 From: scbj Date: Thu, 7 Nov 2024 15:05:50 +0100 Subject: [PATCH] blabla images blabla --- docs/create-image-file.md | 35 -------------------------- docs/image-files.md | 53 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 35 deletions(-) delete mode 100644 docs/create-image-file.md create mode 100644 docs/image-files.md diff --git a/docs/create-image-file.md b/docs/create-image-file.md deleted file mode 100644 index 7737269..0000000 --- a/docs/create-image-file.md +++ /dev/null @@ -1,35 +0,0 @@ - -## get/create image file -download and extract an image file **or** create one using `dd if=/dev/zero of= bs= count=`. - -## set image size -set image size with `truncate --size= `. this is usually used to increase image size in order to increase the file system size (i.e. make more space for rootfs) - -## mount image -to mount an image file use -```bash -mount -o loop -``` -if the image contains multiple partitions one needs to setup a loop device first: -```bash -losetup --find --show -P -``` -afterwards the partitions of the image should be shown as loopXpY and can be mounted like any other device. - -## modify partition table with fdisk - -### resize partition for rootfs - -## resize filesystem - -## mount boot partition - -### make file 'ssh' - -### make user config - -### remove image resize from config file ~'cmdline.txt' - -## mount rootfs partition - -### do stuff diff --git a/docs/image-files.md b/docs/image-files.md new file mode 100644 index 0000000..dad9271 --- /dev/null +++ b/docs/image-files.md @@ -0,0 +1,53 @@ +# image files + +- [create image file](#create-image-file) +- [change image size](#change-image-size) +- [mount image file](#mount-image-file) + + +## create image file + +To create an image file, use: +```bash +dd if=/dev/zero of= bs= count= + +# example: generate image with size of exactly 7.8 Gb +dd if=/dev/zero of=test.img bs=1000000 count=7800 conv=fsync +``` + + +## change image size + +One can change an images size with `truncate --size= `. this is usually used to increase image size in order to increase the file system size (i.e. make more space for rootfs). If the goal is to decrease the memory footprint, extra care has to be taken to not cripple the filesystem. + + +## mount image files + +To mount an image file use: +```bash +mount -o loop +``` +If the image contains multiple partitions one needs to setup a loop device first: +```bash +losetup --find --show -P +``` +Afterwards the partitions of the image should be shown as loopXpY and can be mounted like any other device. + + +## modify partition table with fdisk + +### resize partition for rootfs + +## resize filesystem + +## mount boot partition + +### make file 'ssh' + +### make user config + +### remove image resize from config file ~'cmdline.txt' + +## mount rootfs partition + +### do stuff