Here is the sequence of commands to make disk space usable in Linux for disks >2Tb (so your regular fdisk won’t help you here).
There are tons of variations of different tools, so these commands are for CentOS 6, I’m attaching a 3Tb RAID1 via USB3.
This post is published in How To, Linux, Software.
- BEFORE connecting the disk run
- Connect the disk
ls /dev/sd* again. The difference (let’s assume it’s /dev/sdc) is your new disk
- Run “parted /dev/sdc”, where /dev/sdc is your new disk. Remember to replace /dev/sdc everywhere with your actual disk name or you will destroy information on your existing drive and ti will be non-trivial to restore.
- In parted run
- I want to create single partition that will occupy entire disk, so I run
mkpart primary ext4 0% 100%
p in parted, it will display the current disk partitioning, something like
Model: JMicron H/W RAID1 (scsi)
Disk /dev/sdc: 3001GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Number Start End Size File system Name Flags
1 1049kB 3001GB 3001GB primary
- I do not plan to use logical volume management (LVM), so nothing else should be done here, quit from partd
- Create new ext4 filesystem on the new partition (don’t forget to replace /dev/sdc1 with the actual disk/partition name)
mkfs -t ext4 /dev/sdc1
- Now new partition should be formatted, you need to mount it
# append this in the fstab, don't forget to replace /dev/sdc with your actual drive name
/dev/sdc1 /data ext4 defaults 1 1
- finally mount the new partition
- Your 3Tb disk space is now available:
# df -k /data
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdc1 2884231392 205808 2737515044 1% /data