So I have a need to expand a partition (/tmp) on a system and not understanding exactly how to proceed with this (I did not initially set the partitions up).
The following commands show:
fdisk -l
Disk /dev/sda: 4798.6 GB, 4798552211456 bytes, 9372172288 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
# Start End Size Type Name
1 2048 411647 200M EFI System EFI System Partition
2 411648 1435647 500M Microsoft basic
3 1435648 395407359 187.9G Microsoft basic
4 395407360 446607359 24.4G Microsoft basic
5 446607360 497807359 24.4G Microsoft basic
6 497807360 549007359 24.4G Microsoft basic
7 549007360 569487359 9.8G Microsoft basic
8 569487360 585871359 7.8G Linux swap
9 585871360 6585871360 2.8T Linux filesyste
The various partitions I have created are:
/dev/sda3 on / type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sda4 on /var type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sda9 on /home type ext4 (rw,relatime,data=ordered)
/dev/sda7 on /tmp type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sda2 on /boot type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sda1 on /boot/efi type vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=winnt,errors=remount-ro)
/dev/sda5 on /var/log type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sda6 on /var/log/audit type xfs (rw,relatime,attr2,inode64,noquota)
I see the following sizes allocated:
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 188G 123G 66G 66% /
/dev/sda4 25G 3.8G 21G 16% /var
/dev/sda9 2.8T 224G 2.4T 9% /home
/dev/sda7 9.8G 46M 9.8G 1% /tmp
/dev/sda2 497M 161M 337M 33% /boot
/dev/sda1 200M 9.8M 191M 5% /boot/efi
/dev/sda5 25G 151M 25G 1% /var/log
/dev/sda6 25G 71M 25G 1% /var/log/audit
From what I can see, /dev/sda8 must have been deleting and recreated from an XFS to EXT4 partition.
I need to expand /dev/sda7 to have more space and from a quick tally, /dev/sda is roughly 5TB and we are only using a bit over 3TB for /dev/sda1 --> /dev/sda9. Leads me to believe I have 1-2TB left sitting on /dev/sda. I need to grow this without losing data and preferably without downtime.
I "think" I will need to create another partition (/dev/sda10) and assign this with the desired space. From there I would run "mkfs -t ext4 /dev/sda10" to assign it a filesystem. Then update /etc/fstab to point /dev/sda10 to /tmp (maybe mount /dev/sda10 first and copy all of /tmp over?).
Am I on the correct path for this? Thanks