4

I attached a new hard drive (6TB, /dev/sdb) to my computer (Ubuntu 14.04.4 LTS x64), and tried to create a new partition as follows:

sudo lshw -C disk                # Checking the location of the new drive. It is /dev/sdb.     
sudo parted /dev/sdb mklabel gpt # Creating the GUID Partition Table (GPT)
sudo parted /dev/sdb print       # Checking that the GPT has been created
sudo parted /dev/sdb print unit MB print free # see 6001175MB size
sudo parted --align optimal /dev/sdb mkpart primary ext4 0% 6001175MB # Creating partition

Then I sudo nano /etc/fstab and added the line (I'll use the UUID once I fix this issue):

/dev/sdb1       /crimea ext4 defaults   0       0       # 6 TB: /dev/sdb

and remounted /etc/fstab:

sudo mount -a # Remount /etc/fstab without rebooting

When I run df -h, I do see the new partition, however its size it's much more about that I expected (190M, whereas I expected around 6TB)

/dev/sdb1                      190M   45M  131M  26% /crimea

Why?


sudo parted /dev/sdb print outputs the following, so the new partition should be 6TB from my understanding:

Model: ATA ST6000NM0024-1HT (scsi)
Disk /dev/sdb: 6001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt

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

sudo lshw -C volume however more or less agrees with df. It says the partition is of size 200MiB (while df says 190M):

 *-volume
       description: EXT4 volume
       vendor: Linux
       physical id: 1
       bus info: scsi@1:0.0.0,1
       logical name: /dev/sdb1
       logical name: /crimea
       version: 1.0
       serial: c3554308-795b-46db-9855-8a974c55a1ce
       size: 200MiB
       capacity: 5589GiB
       capabilities: journaled extended_attributes huge_files dir_nlink extents ext4 ext2 initialized
       configuration: created=2016-06-24 14:56:55 filesystem=ext4 lastmountpoint=/boot modified=2016-07-01 17:15:55 mount.fstype=ext4 mount.options=rw,relatime,data=ordered mounted=2016-07-01 17:07:19 name=primary state=mounted
2
  • I ran into behavior like that when using tools that didn't know about GPT (only MBR). But I don't see clues in your question... Aug 13, 2016 at 18:42
  • @ThomasDickey Thanks, yes that's why I avoided fdisk :/ Aug 13, 2016 at 18:43

1 Answer 1

4

parted just sets partition labels; doesn't make the filesystem.

Looking at the configuration line I see

lastmountpoint=/boot

This is telling me that after you partitioned the disk you missed the mke2fs -t ext4 step on the new partition and so you're seeing an older set of data from an older filesystem.

(My guess would be that your sdb disk used to be a primary disk with an OS boot partition on it).

So umount the filesystem then run the mke2fs -t ext4 command then you can mount it and have the full size.

3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .