Sulforaphane
Posts: 49
Joined: Mon Sep 02, 2019 8:29 am

Best way to format a new drive.

Sat Sep 14, 2019 10:11 am

Hello.

I've recently had a bad experience formatting a newly acquired drive to EXT4 on Windows.

Therefore I am curious to what the best, most reliable and safest way of formatting a drive on Raspberry Pi to EXT4?

Thanks in advance!

User avatar
DougieLawson
Posts: 37732
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Best way to format a new drive.

Sat Sep 14, 2019 10:28 am

Use gparted.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
graysky
Posts: 93
Joined: Fri Apr 05, 2013 11:43 am
Location: /run/user/1000
Contact: Website

Re: Best way to format a new drive.

Sat Sep 14, 2019 10:54 am

Never use a Linux native port on Windows for something like formatting a disk. What is wrong with using the provided

Code: Select all

mkfs.ext4
command? Just TRIPLE check you are applying it to the correct partition. If you haven't yet partitioned, use

Code: Select all

fdisk
or

Code: Select all

gdisk
and observe the same warning.

To help:
https://wiki.archlinux.org/index.php/Fi ... ile_system
https://wiki.archlinux.org/index.php/Partitioning

Sulforaphane
Posts: 49
Joined: Mon Sep 02, 2019 8:29 am

Re: Best way to format a new drive.

Sat Sep 14, 2019 4:27 pm

graysky wrote:
Sat Sep 14, 2019 10:54 am
Never use a Linux native port on Windows for something like formatting a disk. What is wrong with using the provided

Code: Select all

mkfs.ext4
command? Just TRIPLE check you are applying it to the correct partition. If you haven't yet partitioned, use

Code: Select all

fdisk
or

Code: Select all

gdisk
and observe the same warning.

To help:
https://wiki.archlinux.org/index.php/Fi ... ile_system
https://wiki.archlinux.org/index.php/Partitioning
After having formated it says with sudo fdisk -l:
/dev/sda1 2048 3906961407 3906959360 1,8T Microsoft basic data

Sulforaphane
Posts: 49
Joined: Mon Sep 02, 2019 8:29 am

Re: Best way to format a new drive.

Sat Sep 14, 2019 4:29 pm

DougieLawson wrote:
Sat Sep 14, 2019 10:28 am
Use gparted.
When formatting it says it has 1 mb unallocated space, that I don't seem to be able to format with gparted. Any way to do this?

User avatar
DougieLawson
Posts: 37732
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Best way to format a new drive.

Sat Sep 14, 2019 6:23 pm

Don't worry about it. In the grand scheme of things 1MB is a drop in the ocean.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
graysky
Posts: 93
Joined: Fri Apr 05, 2013 11:43 am
Location: /run/user/1000
Contact: Website

Re: Best way to format a new drive.

Sat Sep 14, 2019 9:25 pm

Sulforaphane wrote:
Sat Sep 14, 2019 4:27 pm
After having formated it says with sudo fdisk -l:
/dev/sda1 2048 3906961407 3906959360 1,8T Microsoft basic data
I assume you have not yet copied any data to the drive... you need to change the partition type from within fdisk (ext4 is type 'linux' or something similar as I recall). Without seeing the partition layout, I will assume the 1MB of unallocated space is to keep the partition aligned. It's been too long since I needed to partition a drive.

As a general practice, do not invoke commands with sudo unless you really need to ...

Return to “Beginners”