📝 Made further notes on basic partitioning

This commit is contained in:
z3rOR0ne 2025-07-04 20:44:11 -07:00
parent fbdbced7d8
commit 3a90ffc637

View file

@ -3,30 +3,65 @@
# Step 1 is very simple, just download the img from the website, once the img is downloaded, you may need to use xz to extract it. # Step 1 is very simple, just download the img from the website, once the img is downloaded, you may need to use xz to extract it.
```
xz --decompress my_rpi_image.xz xz --decompress my_rpi_image.xz
```
# Once you have the image ready, plug in your sd card and use the command lsblk: # Once you have the image ready, plug in your sd card and use the command lsblk:
```
lsblk lsblk
```
# Usually the device will appear as something like /dev/sda or /dev/sdb, if there are numbers following sda/sdb, those are partitions. # Usually the device will appear as something like /dev/sda or /dev/sdb, if there are numbers following sda/sdb, those are partitions.
# It means there is something already written to the sd card, be sure you're ok with deleting and repartitioning the drive. # It means there is something already written to the sd card, be sure you're ok with deleting and repartitioning the drive.
# To repartition the drive, use the fdisk cli: # To repartition the drive, use the fdisk cli:
```
sudo fdisk /dev/sda sudo fdisk /dev/sda
```
# Type o to clear out any partitions on the drive. # Type o to clear out any partitions on the drive.
# Type p to list the partitions, there shouldn't be any left. # Type p to list the partitions, there shouldn't be any left.
# Write the partition table and exit by typing w. # Write the partition table and exit by typing w.
# If you're using this guide to partition a standard drive larger than 2TB, fdisk won't be able to, but you can use parted instead:
```
parted /dev/sda
```
In the prompt you can create a new GPT table:
```
(parted) mklabel gpt
Warning: The existing disk label on /dev/sdb will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? yes
(parted) unit TB
(parted mkpart primary) 0.00TB 3.00 TB (replace latter with size of partition)
(parted) print
(parted) quit
Then continue by making the ext4 filesystem (see below)
```
# Create the ext4 filesystem: # Create the ext4 filesystem:
```
mkfs.ext4 /dev/sda mkfs.ext4 /dev/sda
```
# Copy rpi image to sd card using dd: # Copy rpi image to sd card using dd:
```
sudo dd if=/path/to/rpi_image.img of=/dev/sda sudo dd if=/path/to/rpi_image.img of=/dev/sda
```
# Depending on the size of the image, this might take a while, there won't be any progress bar or anything , but remain patient, # Depending on the size of the image, this might take a while, there won't be any progress bar or anything , but remain patient,
# it will write the img eventually and then you're all set. # it will write the img eventually and then you're all set.