RaspberryPi storage

jeu. 12 février 2026

My Raspberry Pi 2 uses its SD-Card as main storage for the OS and the user data, usually called home directory. This won't be enough for the data I want to put (service web sites, PIM, saving, photos, movies, etc).

So I need another storage and I buy an external disk (everal Gb or less Tb) and connect to my Raspberry Pi with very cheap hard disk connector and USB-A connection to the Raspberry Pi. The total is not very expensive and will make my data independent from the OS. If I need to change it, just disconnect, install a new OS and reconnect it.

First, I need to format it in order to using it as a classic hard disk. With my USB adapter, I can just connect to my lap/desktop and use a GUI tool to do it like gparted.

  1. Select the disk in list.
  2. Create a partition table.
  3. Create a partition formatted as ext4 to benefit all Linux capacities (ownership, access right, robustness, etc).
  4. Something important, assign a label to retrieve easily in our EHome server.
  5. Run the application (it will take a few minutes).
  6. Unmount the USB disk and connect to our EHome server.

In my case, I create two partitions: * label SERV to put my server data, * label SAVE to use this partition as backup.

Now we have to mount the disk. The different disk partitions corresponds to device /dev/sda1, /dev/sda2, ...

  1. Create a directory of name $PART for mounting a partition.
$ sudo mkdir /$PART
  1. Add an entry (as root) to the fstab
$ sudo echo "LABEL=$PART /$PART ext4 defaults 0 2" >> /etc/fstab
  1. Mount the partition.
$ sudo mount /$PART

Now, the partition can visited and changed as any other partition.

$ cd /$PART
$ ls

It is also ready to get home directories of users, server data, etc.

Category: EHome Tagged: disk partition mount ext4

Page 1 of 1