Avatar billede fredand Forsker
25. november 2020 - 19:53 Der er 1 kommentar

How to change dos to ext4 on a hdd?

Hello guys,
I try to format a hdd, but it keeps saying that I got a dos-partion on it.

My attempt below, what do you think guys is it possible?

pi@raspberrypi-NAS:~ $ sudo fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
  p  primary (0 primary, 0 extended, 4 free)
  e  extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-625142447, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-625142447, default 625142447):

Created a new partition 1 of type 'Linux' and of size 298.1 GiB.
Partition #1 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: Y

The signature will be removed by a write command.

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

pi@raspberrypi-NAS:~ $ sudo tune2fs -L "seagate_320" /dev/sda
tune2fs 1.44.5 (15-Dec-2018)
tune2fs: Bad magic number in super-block while trying to open /dev/sda
Found a dos partition table in /dev/sda
pi@raspberrypi-NAS:~ $ sudo mkfs.ext4 /dev/sda1
mke2fs 1.44.5 (15-Dec-2018)
Creating filesystem with 78142550 4k blocks and 19537920 inodes
Filesystem UUID: ec7aad3f-858c-42c7-99f9-e82358fa282d
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616

Allocating group tables: done                           
Writing inode tables: done                           
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done   

pi@raspberrypi-NAS:~ $ sudo tune2fs -L "seagate_320" /dev/sda
tune2fs 1.44.5 (15-Dec-2018)
tune2fs: Bad magic number in super-block while trying to open /dev/sda
Found a dos partition table in /dev/sda
pi@raspberrypi-NAS:~ $

I also tried to not remove the signature

pi@raspberrypi-NAS:~ $ sudo fdisk /dev/sda

Welcome to fdisk (util-linux 2.33.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): n
Partition type
  p  primary (0 primary, 0 extended, 4 free)
  e  extended (container for logical partitions)
Select (default p):

Using default response p.
Partition number (1-4, default 1):
First sector (2048-625142447, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-625142447, default 625142447):

Created a new partition 1 of type 'Linux' and of size 298.1 GiB.
Partition #1 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: N

Command (m for help): w

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

pi@raspberrypi-NAS:~ $ sudo tune2fs -L "seagate_320" /dev/sda
tune2fs 1.44.5 (15-Dec-2018)
tune2fs: Bad magic number in super-block while trying to open /dev/sda
Found a dos partition table in /dev/sda
pi@raspberrypi-NAS:~ $ sudo mkfs.ext4 /dev/sda1
mke2fs 1.44.5 (15-Dec-2018)
/dev/sda1 contains a ext4 file system
    created on Wed Nov 25 19:47:39 2020
Proceed anyway? (y,N) y
Creating filesystem with 78142550 4k blocks and 19537920 inodes
Filesystem UUID: 88549ecb-3ff5-4265-aa8f-995ae457175b
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616

Allocating group tables: done                           
Writing inode tables: done                           
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done   

pi@raspberrypi-NAS:~ $ sudo tune2fs -L "seagate_320" /dev/sda
tune2fs 1.44.5 (15-Dec-2018)
tune2fs: Bad magic number in super-block while trying to open /dev/sda
Found a dos partition table in /dev/sda

The goal is to use this hdd from my PI.
What do you think guys, is it broken?

Best regards
Fredrik
Avatar billede fredand Forsker
25. november 2020 - 20:07 #1
It looks like I solved it when using gparted, first added a label, then format to ext4
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
IT-kurser om Microsoft 365, sikkerhed, personlig vækst, udvikling, digital markedsføring, grafisk design, SAP og forretningsanalyse.

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester