0

I have an Ubuntu 16.04 system without GUI (only command line) with a very limited root partition (20GB) and 1 storage partition (1000GB) as below

sudo parted -l

Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sda: 21.5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  21.5GB  21.5GB  primary  ext4         boot


Model: QEMU QEMU HARDDISK (scsi)
Disk /dev/sdb: 1074GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags: 

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1074GB  1074GB  primary  ext4

The current status of these disk are:

df -hP
Filesystem      Size  Used Avail Use% Mounted on
udev             27G     0   27G   0% /dev
tmpfs           5.4G  530M  4.9G  10% /run
/dev/sda1        20G   19G  194M  99% /    (almost full!!!!!)
tmpfs            27G  112K   27G   1% /dev/shm
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs            27G     0   27G   0% /sys/fs/cgroup
/dev/sdb1       985G  602G  333G  65% /rasv1 (more space!!!!!)
tmpfs           5.4G   20K  5.4G   1% /run/user/121
tmpfs           5.4G     0  5.4G   0% /run/user/1001

How can I increase the size of root partition for /dev/sda1 (e.g: 20GB -> 100 GB) from /dev/sdb2 (1000GB -> 900GB) online (no liveCD, USB boot, reboot)?

  • 1
    Unless you are using LVM, or zfs (or a few others) I don't think you could borrow for /sdb to feed /sda. But this is a VM - why not make the virtual disk /sda bigger, and expand the file system for it? And make a live USB while you are at this. – Charles Green Feb 11 '19 at 16:19
  • @CharlesGreen thanks, but I only have access to this VM, so seem like no other choice for me. – Bằng Rikimaru Feb 12 '19 at 10:52
  • 1
    OK - summarizing, you have no physical access, the VM administrator will not increase your /sda (this would have to be offline anyhow) and you are space limited. I'm going to vote for re-open, and ask a few questions - please append the results into your original question! – Charles Green Feb 12 '19 at 15:38
  • 1
    1st. Please execute `sudo du -ah -x -d 1 / | sort -rh | head -20` and also `ls -l /boot` – Charles Green Feb 12 '19 at 15:40
  • @CharlesGreen Thanks for your quick actions, I opened a ticket for the admin (if he says nothing I will run your command as this VM I just get controlled recently). – Bằng Rikimaru Feb 12 '19 at 15:48
  • 1
    20 GB should be enough under most circumstances - the commands I wrote are useful in finding out where all the space is being used up. – Charles Green Feb 12 '19 at 15:53

0 Answers0