User avatar
bonzadog
Posts: 254
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

Partitioning + Formating a USB HDD

Fri Feb 14, 2020 11:15 am

Hello,
Sometime the booting from a USB HDD will be released.
I want to use a fast 320GB HDD for boot at a later date and for data usage now.
Perhaps even using it to page virtual storage.

So I want to create a boot partition and a data area(s) . For Rpi 3 and Rpi4 4GB.
The HDD will be used by the RPi3 and RPi4 .

Can someone kindly give me some tips?
Many thanks

fruitoftheloom
Posts: 22080
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Partitioning + Formating a USB HDD

Fri Feb 14, 2020 12:39 pm

bonzadog wrote:
Fri Feb 14, 2020 11:15 am
Hello,
Sometime the booting from a USB HDD will be released.
I want to use a fast 320GB HDD for boot at a later date and for data usage now.
Perhaps even using it to page virtual storage.

So I want to create a boot partition and a data area(s) . For Rpi 3 and Rpi4 4GB.
The HDD will be used by the RPi3 and RPi4 .

Can someone kindly give me some tips?
Many thanks

Why not just clone your current SD Card to the USB Drive, then it will be ready in the future ?
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

User avatar
bonzadog
Posts: 254
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

Re: Partitioning + Formating a USB HDD

Fri Feb 14, 2020 2:01 pm

I must partition + format the HDD first. I am looking in Internet to find out the best way to do that and I do not wish to clone but do everything from "first principles". Sorry, I should have made that clear. I assume there must be at least two partitions, one for the boot system and swap area and , say, two partitions for the data. To access the data areas I must then mount them. I was wondering is there s anything I must do that is specific to the RPi's
Last edited by bonzadog on Fri Feb 14, 2020 2:05 pm, edited 1 time in total.

fruitoftheloom
Posts: 22080
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Partitioning + Formating a USB HDD

Fri Feb 14, 2020 2:05 pm

bonzadog wrote:
Fri Feb 14, 2020 2:01 pm
I must format the HDD first. I am looking in Internet to find out the best way to do that and I do not wish to clone but do everything from "first principles". Sorry, I should have made that clear.

gparted is in repositories to create partitions / format:

https://gparted.org/
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

User avatar
bonzadog
Posts: 254
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

Re: Partitioning + Formating a USB HDD

Fri Feb 14, 2020 2:09 pm

Just found that. I need tow to read up on what ext2 / ext3 / ext4
fat16 / fat32
hfs / hfs+
linux-swap
does and what sizes ( hence my question)

fruitoftheloom
Posts: 22080
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Partitioning + Formating a USB HDD

Fri Feb 14, 2020 2:22 pm

bonzadog wrote:
Fri Feb 14, 2020 2:09 pm
Just found that. I need tow to read up on what ext2 / ext3 / ext4
fat16 / fat32
hfs / hfs+
linux-swap
does and what sizes ( hence my question)

Standalone Raspbian Buster latest release has a 256MB FAT32 Boot Partition, whilst the rest of the space is EXT4, when creating a bottable SD Card


If you use NoobS or PiNN to install, well:

https://github.com/raspberrypi/noobs/wi ... -explained
Retired disgracefully.....
......to an uncomplicated life !

Rather than negativity think outside the box !

User avatar
bonzadog
Posts: 254
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

Re: Partitioning + Formating a USB HDD

Fri Feb 14, 2020 2:33 pm

No I do not want to use NOOBS etc. all from first principles...

User avatar
HawaiianPi
Posts: 5267
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Partitioning + Formating a USB HDD

Fri Feb 14, 2020 4:22 pm

Raspbian Buster with desktop includes the SD Card Copier utility which will clone your SD card to another device (even a USB HDD), and it handles different sized devices gracefully (it just works). You can use that to copy your SD card to your HDD.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

ejolson
Posts: 4506
Joined: Tue Mar 18, 2014 11:47 am

Re: Partitioning + Formating a USB HDD

Fri Feb 14, 2020 4:49 pm

HawaiianPi wrote:
Fri Feb 14, 2020 4:22 pm
Raspbian Buster with desktop includes the SD Card Copier utility which will clone your SD card to another device (even a USB HDD), and it handles different sized devices gracefully (it just works). You can use that to copy your SD card to your HDD.
In the end you will probably want three MBR-style partitions: A tiny partition with ID c W95 FAT32 (LBA) about 256MB, a swap partition about 2 times the size of physical RAM (for example 4GB) with ID 82 Linux Swap and a huge root partition consisting of the remaining disk with ID 83 Linux. Format the tiny partition as FAT32, the swap partition as swap with label SWAP and the root partition using whatever Linux filesystem sounds good such as ext4, btrfs, xfs, reiserfs or jfs. I would also give the filesystem on the huge partition a label reflecting a vanity name for the drive or computer the drive will be connected to, for example, BONZ1 comes to mind.

Now mount a Raspbian formatted SD card on your Linux computer and copy the files in the boot and root partitions of the SD card to respective partitions on the HD using the appropriate tar commands. Don't forget to clear the umask flags before doing the copy.

At this point you may need to fiddle with the cmdline.txt on the SD card to mount root from the HD and /etc/fstab on the HD to mount the swap and remount the root read write.

User avatar
B.Goode
Posts: 9617
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Partitioning + Formating a USB HDD

Fri Feb 14, 2020 5:56 pm

bonzadog wrote:
Fri Feb 14, 2020 2:33 pm
No I do not want to use NOOBS etc. all from first principles...
and previously -
I do not wish to clone but do everything from "first principles".

Your determination to learn by doing is admirable.

But the images of the Raspbian Operating System distributed by Raspberry Pi are effectively themselves 'cloned' from the RPi development/packaging system. They contain implicit information about the partitions that will be created on the target media when the image is 'flashed' to that media.

How far back does your search for 'first principles' take you... ? Will you be building an Operating System (kernel, utilities and applications) from source?

User avatar
bonzadog
Posts: 254
Joined: Wed Apr 25, 2012 9:40 am
Location: Rietberg/Germany

Re: Partitioning + Formating a USB HDD

Sat Feb 15, 2020 9:56 am

B.Goode wrote:
bonzadog wrote:
Fri Feb 14, 2020 2:33 pm
No I do not want to use NOOBS etc. all from first principles...
and previously -
I do not wish to clone but do everything from "first principles".

Your determination to learn by doing is admirable.

But the images of the Raspbian Operating System distributed by Raspberry Pi are effectively themselves 'cloned' from the RPi development/packaging system. They contain implicit information about the partitions that will be created on the target media when the image is 'flashed' to that media.

How far back does your search for 'first principles' take you... ? Will you be building an Operating System (kernel, utilities and applications) from source?
Building an OS: No, but I would love to try that out. Perhaps I could look at that much, much later. In fact writing a primitive OS system does appeal to me. Ages ago I wrote some drivers in assembler + HAL/S but had worked in high level languages mostly.

I now want Boot partition, swap area, two Partitions for FAT32 data and one partition for NTFS. I understand that I would meed to load a NTFS drive on the RPi to cope with Win files.

Ideally I would like multiple boot partition, so I can select which OS I wish to use....but that would be a "nice to have" feature. But I want to get a single boot system up a running before I attempt this.

Since retirement, the RPi4 keeps me active and I like working with the Rpi.

Thanks for the assistance.

Return to “Beginners”