fdisk -l
create a new GPT partition table by typing
gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.5
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
create a new partition by typing n followed by the partition number 1
Command (? for help): n
Partition number (1-128, default 1): 1
and agree to all further prompts
finally, type “w” to write the changes to the drive and confirm by typing “Y”
First sector (34-11721045134, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-11721045134, default = 11721045134) or {+-}size{KMGTP}:
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300):
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/sdb.
The operation has completed successfully.
Assuming target fs is ext4
and device is /dev/sdb1
mkfs.ext4 /dev/sdb1
mkdir /var2
mount /dev/sdb1 /var2
rsync -a /var/ /var2
Run blkid
and copy the UUID
of /dev/sdb1
UUID="<UUID from previous step>" /var ext4 defaults 0 2
You can cleanup the old /var
to free up space by mounting /
to another location using a LiveCD.