Sunday, April 28, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 50324  / 1 Year ago, sun, february 19, 2023, 3:42:50

I'm running Ubuntu Server 10.04 on a remote server as a VM. I only have access to the VM.



The VM is assign a disk space of 20GB, however the drive is currently only partitioned to use about 4.7GB.



I know that you can use LiveCD to repartition a drive using gparted. How would you go about doing that on a remote VM? (Since the partition is also the startup volume)



# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00074164

Device Boot Start End Blocks Id System
/dev/sda1 * 1 618 4959232 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 618 653 280577 5 Extended
Partition 2 does not end on cylinder boundary.
/dev/sda5 618 653 280576 82 Linux swap / Solaris

More From » server

 Answers
4

That what I would try:




  1. Many VPS hosting providers have tools to manipulate partitions in their control panels. Getting access to the control panel would be the safest option.


  2. Do not resize the partition but create a second partition and move your "working" data to that partition. I'e. mount /home or wherever your data is to a separate partition


  3. If you still feel adventurous, try remounting the boot partition read-only and see if it's possible to resize it while mounted read-only


  4. Something really tricky like remove swap - create a copy of your root partition at the very end of the drive - configure grub to boot from the new partition - reboot - resize your original partition - copy the data back - modify grub again - reboot - remove the temporary root partition - create a swap partition again.




I would consider the second two options really dangerous in the sense that if anything goes wrong your system just won't boot so you'd lose any access to the system.


[#40086] Sunday, February 19, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eatack

Total Points: 245
Total Questions: 120
Total Answers: 113

Location: Estonia
Member since Wed, Jun 8, 2022
2 Years ago
eatack questions
Sun, Mar 6, 22, 20:44, 2 Years ago
Tue, Feb 8, 22, 20:50, 2 Years ago
Sat, May 20, 23, 13:30, 1 Year ago
;