To view the uptime for the current boot in Linux, you can use the command who -b, which shows the last system boot time. Alternatively, you can use last reboot to see a list of all reboots along with their timestamps.
Since we are working with a FAT16 partition inside a .img file on Linux, we cannot simply use resize2fs (that's for ext filesystems). We must first ensure the partition table reflects the new size, and then use a FAT-specific tool to expand the filesystem.
Here is the step-by-step process:
First, verify the current partition table and filesystem size. Replace your-image.img with your actual filename.
# View the partition table (look for the "Size" column)
fdisk -l your-image.imgSources: r/homelab, r/UgreenNASync, r/selfhosted +6 more
Running light Docker containers on Alpine Linux with 512MB of RAM is a challenging but potentially feasible task. Here are some insights and recommendations from Redditors who have tackled similar setups:
To extend a Btrfs filesystem to fill the entire disk, use the command btrfs filesystem resize max /mount-point, where /mount-point is the path to your Btrfs filesystem. This command will resize the filesystem to utilize all available space on the disk. (Do this online).
To remove old UEFI boot entries on Windows, open an elevated Command Prompt and run bcdedit /enum firmware to list all firmware applications, then copy the identifier (GUID) of the entry you wish to remove.
Once the identifier is identified, execute the deletion command bcdedit /delete {identifier}, replacing {identifier} with the specific GUID enclosed in curly braces. It is critical to back up your current boot configuration using bcdedit /export before deletion to prevent boot failure if a necessary entry is removed by mistake.
- List Entries:
bcdedit /enum firmware - Delete Entry:
bcdedit /delete {GUID} - Backup:
bcdedit /export newbcd
To safely truncate a dd disk image, you must first shrink the filesystem and partitions within the image to remove empty space, as simple truncation can corrupt partition tables, especially on GPT-formatted disks.
For GPT-partitioned images, the critical step is preserving the backup partition table located at the disk's end. Simply truncating the file will remove this backup, rendering the image unbootable on legacy BIOS systems. The safe procedure involves:
- Mount the image as a loop device using
sudo losetup --partscan -f -P myimage.img. - Shrink the filesystem (e.g.,
sudo e2fsck -f /dev/loop0p2followed bysudo resize2fs /dev/loop0p2 5G). - Resize the partition to match the new filesystem size using
sudo parted /dev/loop0 unit s resizepart 2.