Ok so let me try to explain it as thoroughly as possible. So I'm using chameleon cloud to reserve nodes on bare metal (~distant computers) and access them via ssh. These nodes run Ubuntu 20.04, and the ones I have access to only have 1 SSD, this is important as the project I am in requires only SSD's.
Root is on sda1 on the ssd, and sda1 occupies the whole ssd.
Basically I want to shrink sda1 (which contains root), to create another partition on the SSD and mount another filesystem for my project on it(this filesystem will change throughout the course of the project, btrfs, xfs, etc). So, the original EXT4 filesystem will stay on sda1, I need an extra partition with another filesystem. But since this is not a machine I have physical access to, I cannot use a usb stick or a CD to reinstall, etc.
I understand this might be confusing, maybe incorrect or incomplete. This is also probably not a new question, but I can't find satisfying answers that can adapt to my case. My project lead thinks that this is a solvable issue. Feel free to ask for more details (screenshots of commands, or whatever), correct errors, help me, anything is welcome.
I thank you very much for your time and help.
resize2fs
to shrink the filesystem. It requires a reboot to make that effective as far as I know. After the reboot, usefdisk
orparted
to modify the partition table onsda
. If this server contains anything of value, take a backup before you manipulate partition sizes. – berndbausch Feb 26 '21 at 03:47parted
on Ubuntu 20 may have aresizepart
command, which can (I think) resize both the filesystem and the partition. This would make the task easier and less dangerous. – berndbausch Feb 26 '21 at 03:48resize2fs
to shrink a mounted partition, only grow it. – Philip Couling Feb 26 '21 at 08:08resize2fs
to shrink a filesystem while it is mounted. – psusi Feb 26 '21 at 18:44