![]() When you change root, your session will use the binaries from the new root. In my opinion, the easiest way to make changes to the image is to use chroot to change the working root of your session to that of the mounted image. Once the disk image has been decompressed and mounted to a spot on the host computer, it is time to start modifying the image to suit your needs. $ ls ~/mnt Work directly within the disk image This means you need to mount the file with an offset of 595591168 to be in the right place at the mount point.ĪRMed (see what I did there?) with this information, you can now mount the third partition to a directory in your homedir: $ mkdir ~/mnt The third partition starts on sector 1163264 (indicated by the "Start" column in the output of fdisk), so your mount offset is 595591168, calculated by multiplying the sector size (512) by the start sector (1163264) (i.e., 512 * 1163264). This should contain the partition and data you want to modify. The third partition is what you probably want: it is 2.3GB, so it should have the majority of the distribution on it, and it is a Linux-native partition type, which is expected. This partition is a Linux native-type partition (Id 83), and it probably is the Linux boot partition containing the kernel and initramfs. The second partition is not very large either, just 488MB. ![]() The first one, 1 is no doubt the bootloader partition because it is the first, small (only 76MB), and type W95 FAT32 (LBA), as identified by the Id "c," a FAT32 partition for booting off the SD card. The list of devices shows the partitions inside the raw disk image. Line 3 indicates the sector size, both logical and physical: (512 bytes / 512 bytes). Sector size (logical/physical): 512 bytes / 512 bytes Luckily, you can use the fdisk command on a disk image just as easily as on a real disk and use the -list or -l argument to view the list of partitions and their information: # Use fdisk to list the partitions in the raw image: You need to mount the partition you intend to work in, but to do that, you need information about where that partition starts in the disk image and the size of the sectors on the disk, so you can mount the file at the right sector. That includes partition information, the boot partition, the root partition, and any other partitions. This raw disk image is just what it sounds like: a file containing all the data that would be on a formatted and installed disk. This leaves you with a raw, decompressed disk image (which automatically replaces the. You can use the xz command to decompress the Fedora Server image by using the -decompress argument: xz -decompress After you download the disk image and verify its checksum, you need to decompress and mount it to a location on the host computer's file system so you can modify it as needed. I used the Fedora Server 31 ARM image during testing. Later, you can do more specialized, in-depth configurations using automated processes over an SSH connection.Īlso, as you add more Pis to your lab, modifying disk images lets you just write the image to an SD card, drop it into the Pi, and go!įor this project, you need to modify a server disk image. ![]() This is a great way to make your devices "boot and go," similar to cloud instances. This article explains how to modify a disk image for the Raspberry Pi or another SBC, pre-configure the host for SSH (secure shell), and disable the service that forces interaction for configuration on first boot. Creating a "private cloud at home" is also a great way to get exposure to cloud-native technologies for considerably less money than trying to replicate the same setup with a major cloud provider. Thanks to the popularity of single-board computers (SBCs), led by the Raspberry Pi, it is easier than ever to build a multi-computer lab right from the comfort of your home. Building a homelab can be a fun way to entertain yourself while learning new concepts and experimenting with new technologies.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |