Format drive larger than 2TiB in Alicloud
---date: Aug 28, 2019
tags:
- Linux
- Ubuntu
- Server
language: English
---
This post is more than 6 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
partedande2fsprogsare 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:
printto check partition then exit byexit.- Run
partprobeto 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 /storageto mount at/storage.umount /storageto un-mount.
Startup Setup
- Backup fstab by
cp /etc/fstab /etc/fstab.bak. echo /dev/vdb1 /storage ext4 defaults 0 0 >> /etc/fstabfor ext4 andecho /dev/vdb1 /storage xfs defaults 0 0 >> /etc/fstabfor xfs.- Verify by
cat /etc/fstab.
