1

I have followed the procedures in other AskUbuntu question, however, it did not solve my issue. I have a 6T hard drive with the following info:

Disk /dev/sdb: 6001.2 GB, 6001175126016 bytes
255 heads, 63 sectors/track, 729601 cylinders, total 11721045168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1  4294967295  2147483647+  ee  GPT
Partition 1 does not start on physical sector boundary.

and,

Model: ATA WDC WD6002FRYZ-0 (scsi)
Disk /dev/sdb: 6001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

Number  Start   End     Size    File system  Name  Flags
 1      2097kB  6001GB  6001GB  ext4

That I would like to add to the existing /dev/sda and mount it for further storage. Using Gparted, I did set the starting location at 1 MiB, 2 MiB, and 4MiB to conform with the 4096 sector size, yet it gives me the warning again. Any suggestions are appreciated. My start default at fdisk was 6 and using it also gave the warning again. More info:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2        92G   23G   65G  26% /
none            4.0K     0  4.0K   0% /sys/fs/cgroup
udev             16G   12K   16G   1% /dev
tmpfs           3.2G  1.4M  3.2G   1% /run
none            5.0M     0  5.0M   0% /run/lock
none             16G  152K   16G   1% /run/shm
none            100M   32K  100M   1% /run/user
/dev/sda3        92G   12G   76G  13% /opt
/dev/sda4       705G  562G  108G  84% /home
/dev/sdb1       5.5T   58M  5.2T   1% /TF

and,

*-volume
                description: EXT4 volume
                vendor: Linux
                physical id: 1
                bus info: scsi@2:0.0.0,1
                logical name: /dev/sdb1
                logical name: /TF
                version: 1.0
                serial: e8e573af-8306-4314-acc0-975100227f08
                size: 5589GiB
                capabilities: journaled extended_attributes large_files huge_files dir_nlink recover extents ext4 ext2 initialized
                configuration: created=2018-10-11 19:57:14 filesystem=ext4 label=TF modified=2018-10-11 20:09:26 mount.fstype=ext4 mount.options=rw,relatime,data=ordered mounted=2018-10-11 20:09:26 state=mounted

Update: I did not have X11 access, and thus were interested in using cli methods.

Amir
  • 1,061

2 Answers2

2

Since you are on an Ubuntu 14.04, use gparted or gdisk, not fdisk on gpt partitioned disks. For Ubuntu 16.04 or later, it doesn't matter, fdisk has been updated to work on gpt disks.

Start your first partition at 2048 bytes (not kilobytes!). Sector number starts at 0, but avoid the beginning where bootloaders or partition tables typically get dumped.


I don't see 2048k in what you posted, just 2097k, which is wrong.

ubfan1
  • 17,838
2

Assuming that this is a fresh new drive with no data on it, use gparted to lay down a fresh GPT partition table, then delete partition 1 (if it's still there after the new partition table), and recreate it with the following options set...

enter image description here

Update #1:

Note: gparted and/or gdisk should be used on GPT partitioned disks. Not fdisk.

Update #2:

Since you're using remote SSH, and no X11 GUI, use parted or gdisk to create/check aligned partitions.

heynnema
  • 70,711
  • So using 0 MiB will align the start to the first default sector, right? If yes, I already tested that with fdisk and the default (which was 6) failed again. – Amir Oct 12 '18 at 18:41
  • 1
    @Amir don't use fdisk, use gparted. Lay down a fresh GPT partition table, and then use my process to create a fresh partition. gdisk is for GPT disks. Report back. – heynnema Oct 12 '18 at 18:54
  • I did that using parted and using 0 failed again. I found a workaround instead and I used percentages instead, so I used: sudo parted /dev/sdb1 NAME ext4 0% 100% and apparently it did go well with no warning. I check the optimal alignment of parted and returned aligned. Also, tested performance using hdparm and its speed is as expected. I just don't know why sudo fdisk -l still nags with the same warning. – Amir Oct 13 '18 at 22:28
  • @Amir I don't know why you insist on using fdisk and parted after I've outlined a clear and simple approach to fixing your problem. fdisk is for MBR disks, not GPT disks. parted requires the use of the -a optimal option to align partitions. If you'd just follow my instruction and use gparted, you'd have been done yesterday. Please try it, and then accept my answer if it was helpful. Thanks. – heynnema Oct 13 '18 at 22:57
  • I am using ssh remotely and X11 is not available at this point. – Amir Oct 13 '18 at 23:07
  • @Amir then you still need to use parted -a optimal or gdisk to create/align partitions... not fdisk, or percentages :-) – heynnema Oct 13 '18 at 23:09
  • I guess you misunderstood what I mentioned first. I used parted as the cli version of gparted and I aligned the partition using percentages and the parted -a optimal returned good. – Amir Oct 13 '18 at 23:19
  • 1
    No, I understand that you used parted, because you don't have a GUI. But parted -a optimal is different than parted align-check optimal /dev/sdb1. Please edit your original question with the additional info about using SSH remotely, and no X11. – heynnema Oct 13 '18 at 23:25
  • still I don't understand why sudo fdisk -lreturns with Partition 1 does not start on physical sector boundary. even after sudo parted align-check optimal /dev/sdb1 passed. Is it because of this warning: WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted. ?? – Amir Oct 14 '18 at 01:59
  • 1
    Did you lay down a new GPT partition table, as I suggested, before creating the new partition? As fdisk was supposedly upgraded to handle GPT, maybe there are some bugs, but the error "The util fdisk doesn't support GPT" is what I've been saying all along. In your SSH situation, parted and gdisk are still the best choices. – heynnema Oct 14 '18 at 13:50