# New HDD partitioning issues with ext4 [SOLVED]

## bulliver

Hello,

Bought a brand new 3TB SATA hard drive and installed it into my box. Running into many issues simply trying to partition and create a file system on it, something that has always been easy before. The disk is for photos, and I simply want to use the entire drive for one partition. It does not need to be bootable, or anything like that. 

As soon as I opened it with fdisk there is a message stating:

```
The size of this disk is 2.7 TiB (3000592982016 bytes). DOS partition table format can not be used on drives for volumes larger than (2199023255040 bytes) for 512-byte sectors. Use GUID partition table format (GPT).
```

OK then, so I use 'g' to create a GPT partition table. I then add a single partition using the defaults (start sector 2048, end sector 5860533134). Write it, then run mkfs.ext4, however: 

```

mke2fs 1.42.10 (18-May-2014)

/dev/sde1 alignment is offset by 3584 bytes.

This may result in very poor performance, (re)-partitioning suggested.

Creating filesystem with 536870911 4k blocks and 134217728 inodes

Filesystem UUID: a2e0972d-6bf8-4bc6-9c9c-8b09ec5a5f31

Superblock backups stored on blocks: 

        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 

        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 

        102400000, 214990848, 512000000

Allocating group tables: done                            

Writing inode tables: done                            

Creating journal (32768 blocks): done

Writing superblocks and filesystem accounting information: done     

```

OK then, 512b sectors,  3584 / 512 = 7, so I fire up fdisk again and this time make 2055 the start sector.

Try mkfs.ext4 again and get the EXACT same error. So this alignment has nothing to do with sectors?

I do a bit of googling, and everyone who has this alignment warning seems to be setting up RAID. One thing I do see is to use parted to check alignment. So I do so:

```

(parted) align-check minimal                                              

Partition number? 1                                                       

1 aligned

(parted) align-check optimal 1

1 aligned

```

So parted seems to think the alignment is OK...

So I think whatever, and just mount the partition.

df -h gives me this:

```
/dev/sde1       2.0T   71M  2.0T   1% /root/test
```

What?

fire up fdisk again:

```

Device    Start          End   Size Type

/dev/sde1  2048   5860533134   2.7T Linux filesystem

```

Where did those 700GB go?

Also, now everytime I open the disk in fdisk I get this:

```
The primary GPT table is corrupt, but the backup appears OK, so that will be used.
```

...even when I make it from scratch every time. What's going on?

This is a brand new disk, there must be someway to set up a single partition that ext4 likes?

I have fdisk, cfdisk, parted, and even sfdisk installed here. Can someone shine some light on what my problem might be?

----------

## Jaglover

Why are you trying to partition it for a single filesystem? Partitioning is only useful if you want to use more than one filesystem on given block device.

----------

## bulliver

Uhm, good question. I have never used a single disk for one partition/file system  before, I guess I thought it was necessary to have a partition before installing the filesystem.

Are you saying I just have to do a 'mkfs.ext4 /dev/sde'?

----------

## bulliver

```
/dev/sde        2.7T   73M  2.7T   1% /root/test
```

..well there you go. Learn something new everyday.

----------

## Logicien

If you use /dev/sde to make an ext4 filesystem, check at which sector the filesystem start. It can scrap the filesystem if you install a boot loader in the Mbr if the filesystem start before sector 2048.

By default, mkfs do not allow to make a filesystem on an whole disk I think.

----------

## Jaglover

 *Logicien wrote:*   

> If you use /dev/sde to make an ext4 filesystem, check at which sector the filesystem start. It can scrap the filesystem if you install a boot loader in the Mbr if the filesystem start before sector 2048.
> 
> By default, mkfs do not allow to make a filesystem on an whole disk I think.

 

OP clearly stated there is no booting from this device.

Your second statement is groundless, too.

----------

## Logicien

I have'nt say I was on solid ground.

----------

## bulliver

Yes, my issue is as good as solved. I honestly didn't know you could do that. Just assumed at least a single partition was necessary to install the file system.

Though, if anyone is bored, I still wouldn't mind knowing why mkfs.ext4 was so upset, and how to fix such an alignment problem in case it crops up some time in the future.

----------

## Jaglover

What is partition?  :Razz: 

----------

## Logicien

Your disk is new. It can be the fasted you have. In that case, interesting would be to put an operating system on it. You will have to make partitions. You can schrink your whole disk filesystem and put it in a partition that will be smaller than the whole disk. That will free space to create other partitions.

With GPT partition tables, the Mbr is not use because most GPT disks are in an EFI boot mode that use an EFI partition to store bootloaders. The start of the whole disk filesystem is important in DOS/MBR where a bootloader is store starting a the first sector and can use sectors up to 2047 (first sector is in fact sector 0).

----------

## Jaglover

 *Logicien wrote:*   

> Your disk is new. It can be the fasted you have. In that case, interesting would be to put an operating system on it. You will have to make partitions. You can schrink your whole disk filesystem and put it in a partition that will be smaller than the whole disk. That will free space to create other partitions.
> 
> With GPT partition tables, the Mbr is not use because most GPT disks are in an EFI boot mode that use an EFI partition to store bootloaders. The start of the whole disk filesystem is important in DOS/MBR where a bootloader is store in the first sector.

 

My hat is off on this one. What is your favorite drink?

----------

## Logicien

If you have something more intelligent than me to say, I am open. It should be easy according to you.

----------

