disk partion loop instead of gpt

Issues related to hardware problems
nix99
Posts: 20
Joined: 2014/03/31 05:04:08

Re: disk partion loop instead of gpt

Post by nix99 » 2015/01/17 15:02:08

TrevorH wrote:Your problem is that you partitioned the drive into /dev/sdc1 and then you ran mkfs on /dev/sdc not on /dev/sdc1. It then wrote over the top of the partition table you created and it's not there any more. You can quite happily partition it into one partition but when you mkfs it, use /dev/sdc1 not /dev/sdc.
when I created the 2 partition that is just to check if gpt will not be changed to loop, I tried gdisk/gparted the disk both ways (with one partition and then 2) just to see if its going to make a different

I didnt mkfs mkfs on /dev/sdc when it has 2 partitions or the opposite.

sorry if I didnt make this clear coz english isnt my pri language :)

now I understand if I partition the drive (3tb) in one partition and the partition table is 'loop' will be ok, right?

Thank you.

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: disk partion loop instead of gpt

Post by Super Jamie » 2015/01/17 21:47:04

nix99 wrote:now I understand if I partition the drive (3tb) in one partition and the partition table is 'loop' will be ok, right?
No, you still don't understand what you've done.

Think of the contents of the disk.

When you start, the disk is blank:

Code: Select all

--------------------------------------------------------------------------------
Here you have run parted and made a GPT partition. The GPT below is the partition table:

Code: Select all

-GPT---------------------------------------------------------------------------
Now if you run parted, it will report a "gpt" type of partition table.

Now you have run mkfs.ext4 against the disk (/dev/sdX) not the partition (/dev/sdX1), so mkfs has overwritten the previous data with an ext4 filesystem. Now the disk only contains a filesystem:

Code: Select all

ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4---
Now if you run parted, there is no partition table, but parted is smart enough to read the ext4 filesystem and report it is present. However there is still no partition table. Parted sees there is no partition table so it reports "loop".

There is nothing wrong with this. It will work fine.

However, if you wish to run with a partition table you can, and if you wish to make multiple partitions (multiple filesystems on the one disk) then you must have a partition table.

So you could make a partition table like before. Here I will use ^ to mark the start of two partitions, though there is no actual mark on the disk:

Code: Select all

-GPT-^---------------------------------------------------^---------------------
Now if you mkfs against the partitions (/dev/sdX1 and /dev/sdX2) you would end up with something like this, where each separate "block" of ext4ext4 is a different filesystem:

Code: Select all

-GPT-^ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4ext4---^ext4ext4ext4ext4ext4-
I hope that makes it a bit clearer.

nix99
Posts: 20
Joined: 2014/03/31 05:04:08

Re: disk partion loop instead of gpt

Post by nix99 » 2015/01/17 22:44:05

ok, to make it easier for me, lets say I want to have the whole disk /dev/sdc and not 2 partitions, in this case I should do:

gdisk /dev/sdc and create 1 partition only uses the whole space

then,

mkfs.ext4 /dev/sdc

right?

User avatar
Super Jamie
Posts: 310
Joined: 2014/01/10 23:44:51

Re: disk partion loop instead of gpt

Post by Super Jamie » 2015/01/18 00:34:36

No, the last step should be mkfs.ext4 /dev/sdX1

Note the 1 on the end meaning "first partition"

You need to make the filesystem on the partition, not the disk

nix99
Posts: 20
Joined: 2014/03/31 05:04:08

Re: disk partion loop instead of gpt

Post by nix99 » 2015/01/18 01:18:13

Super Jamie wrote:No, the last step should be mkfs.ext4 /dev/sdX1

Note the 1 on the end meaning "first partition"

You need to make the filesystem on the partition, not the disk
gnow got what you mean and fixed it:

Code: Select all

Model: ATA HGST HUS724030AL (scsi)
Disk /dev/sdc: 3001GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End     Size    File system  Name     Flags
 1      1049kB  3001GB  3001GB  ext4         primary
Thank you so much for the help..

Post Reply