Format drive larger than 2TiB in Alicloud
---date: Aug 28, 2019
tags:
- Linux
- Ubuntu
- Server
language: English
---
This post is more than 3 years old. If this is a technical post, the post will most likely not working, but feel free to try it and see if it works.
TL;DR
This is a quick reference for formatting Alicloud cloud drive that is higher than 2 TiB because the original guide is messy.
Steps
- Check
parted
ande2fsprogs
are both installed. - Usually cloud drive is automatically mounted at
/dev/vdb
,/dev/vdc
, etc. check usingfdisk -l
. - Run
parted /dev/vdx
. - In new prompt, run
mklabel gpt
. - Create partition.
- For ext4:
mkpart primary ext4 0 -1
. - For xfs:
mkpart primary xfs 0 -1
.
- For ext4:
print
to check partition then exit byexit
.- Run
partprobe
to make system re-read the partition table. - Set property to partion.
- For ext4:
mke2fs -O 64bit,has_journal,extents,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize /dev/vdb1
. - For xfs:
mkfs -t xfs /dev/vdb1
.
- For ext4:
mkdir /storage && mount /dev/vdb1 /storage
to mount at/storage
.umount /storage
to un-mount.
Startup Setup
- Backup fstab by
cp /etc/fstab /etc/fstab.bak
. echo /dev/vdb1 /storage ext4 defaults 0 0 >> /etc/fstab
for ext4 andecho /dev/vdb1 /storage xfs defaults 0 0 >> /etc/fstab
for xfs.- Verify by
cat /etc/fstab
.