Increase size in dev/sda
9,702
My suggestion is to get a partition editor like gparted https://gparted.org/
- Put it on your datastore.
- Go into the properties of the VM and assign the ISO to the virtual CD/DVD
- Boot the VM, and press ESC and you should get a boot menu
- Select virtual CD/DVD
- Boot
- When loaded launch gparted, and you can then visually see what is going on.
- Delete,add, resize, or etc the necessary partitions.
- Commit your changes
- Wait for that to complete
- Reboot
- Don't press any key and it should boot normally.
Related videos on Youtube
Author by
Krishnam
Updated on September 18, 2022Comments
-
Krishnam almost 2 years
Alright people be nice. First question here. I tried searching on blogs but could get anywhere.
I am using Debian which is on VMware so case may be little different.
Situation:
This is machine setup in VMware environment in data center, so I can not put bootable disk.
I have two option :
Resizing some dev/sda1 partition which seems impossible. So I have decided to do option 2.
Add another partition with remaining of disk space.
I already increased size on VMware to 300 GB (I also tried adding another disk 1st 30 GB, second 200 GB).
+++++++++++++++
less /proc/version Linux version 3.16.0-4-amd64 ([email protected]) (gcc version 4.8.4 (Debian 4.8.4-1) ) #1 SMP Debian 3.16.7-ckt20-1+deb8u2 (2016-01-02) /proc/version (END) root@Penxxy3:/# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 29G 29G 0 100% / udev 10M 0 10M 0% /dev tmpfs 1.6G 29M 1.6G 2% /run tmpfs 4.0G 12K 4.0G 1% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 4.0G 0 4.0G 0% /sys/fs/cgroup 10.224.0.124:/data/backups/xxmer 11T 521G 11T 5% /homer tmpfs 801M 4.0K 801M 1% /run/user/1000 root@PentahoSy3:/#
++++++++++++++
Command (m for help): p Disk /dev/sda: 300 GiB, 322122547200 bytes, 629145600 sectors <<<<< 300 GiB Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x8476ef5a Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 60262399 60260352 28.8G 83 Linux /dev/sda2 60264446 62912511 2648066 1.3G 5 Extended /dev/sda5 60264448 62912511 2648064 1.3G 82 Linux swap / Solaris Command (m for help): m Command (m for help): n Partition type p primary (1 primary, 1 extended, 2 free) l logical (numbered from 5) Select (default p): Using default response p. Partition number (3,4, default 3): First sector (60262400-629145599, default 60262400): Last sector, +sectors or +size{K,M,G,T,P} (60262400-60264445, default 60264445): Created a new partition 3 of type 'Linux' and of size 1023 KiB. Command (m for help): p Disk /dev/sda: 300 GiB, 322122547200 bytes, 629145600 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 Disklabel type: dos Disk identifier: 0x8476ef5a Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 60262399 60260352 28.8G 83 Linux /dev/sda2 60264446 62912511 2648066 1.3G 5 Extended /dev/sda3 60262400 60264445 2046 1023K 83 Linux /dev/sda5 60264448 62912511 2648064 1.3G 82 Linux swap / Solaris
Any idea how can i add another partition with rest of 260 odd GB ?
-
Krishnam over 8 yearsI added another HDD in vmware dev/sdb with 200 GB and was able to partition that using fdisk /dev/sdb but I can not see that shown. root@PentahoSy3:/# fdisk /dev/sdb Disk /dev/sdb: 200 GiB, 214748364800 bytes, 419430400 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 Disklabel type: dos Disk identifier: 0x28205cd1 Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 419430399 419428352 200G 83 Linux
-
Paul over 8 yearsOh I see, you tried to make a new partition, but it would only create 1023K partition?
-
cybernard over 8 yearsWhen extending a partition the extended space in not automatically added to the exist space, instead it becomes unused space after the partition. You need to get an ISO copy of gparted or partedmagic or etc. Boot, and use it to increase the size of the existing partition to include the unused space.
-
Krishnam over 8 yearsalso tried wit with adding diff partition. There is limit on characters left so I cant share output here. root@PentahoSy3:/# df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 29G 29G 0 100% / udev 10M 0 10M 0% /dev tmpfs 1.6G 8.9M 1.6G 1% /run Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 419430399 419428352 200G 5 Extended
-
Paul over 8 years@Krishnam And what happened?
-
Paul over 8 yearsOh wait, I see. The extended partition was created when the disk was only 30GB, and so it doesn't know about the rest of the space.
-
Paul over 8 yearsYou don't seem to be using sda2 and sda3, and sda5 is swap. Could you turn swap off, then delete these three partitions?
-
Krishnam over 8 yearsOk searching on how to disable swap.
-
Paul over 8 years@Krishnam You can edit your original question if you have additional information to add. This is best practice so anyone else who gets here can see everything in one place.
-
Paul over 8 years
swapoff /dev/sda5
-
Krishnam over 8 yearsK Disabled. Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 60262399 60260352 28.8G 83 Linux /dev/sda2 60264446 62912511 2648066 1.3G 5 Extended Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Re-reading the partition table failed.: Device or resource busy Havent rebooted yet. Safe to go ahead ?
-
Younes El Ouarti over 2 yearsThis needs a way higher score. It's a very simple solution. Basically just download gparted and the GUI is selfexplanatory.