# Resizing sda1 on google cloud SUSE

**URL:** <https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750>\
**Category:** SLES Configure-Administer\
**Created:** [May 3, 2017, 9:44pm UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750 "2017-05-03T21:44:25Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kvothe](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@kvothe](https://forums.suse.com/u/kvothe)\
**Post date:** [May 3, 2017, 9:44pm UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750/1 "2017-05-03T21:44:25Z")

</div>

Hello,  
I am using a VM image provided by SAP on google cloud which runs on SUSE. The original configuration of the image was 36 GB, however when I created the image I increased it to 120 GB as I knew I will have to install few other components to it. When I ssh into the system I see that the /dev/sda1 is allocated only 36GB.

`> df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 13G 0 13G 0% /dev
tmpfs 13G 0 13G 0% /dev/shm
tmpfs 13G 9.7M 13G 1% /run
tmpfs 13G 0 13G 0% /sys/fs/cgroup
/dev/sda1 36G 33G 661M 99% /
tmpfs 2.6G 0 2.6G 0% /run/user/490
tmpfs 2.6G 0 2.6G 0% /run/user/1004
tmpfs 2.6G 0 2.6G 0% /run/user/1005
`

But the disksize available is 120GB.

`> sudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 120G 0 disk
&#9492;&#9472;sda1 8:1 0 36G 0 part /
`

How do I allocate more space from sda to sda1 ?

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [May 3, 2017, 10:09pm UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750/2 "2017-05-03T22:09:00Z")

</div>

Could you show us the partition table for the disk/device as well as the  
filesystems in use?

```auto
fdisk -l /dev/sda
mount | grep sda
```

The things I usually try include using ‘yast disk’ (Partitioner) to resize  
the disk, though that may not work for the root filesystem while it is  
online, and may depend on the filesystem used and partitions on the disk  
(see commands above), or else I would try ‘parted’.

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the  
forum as I do not use the web interface often.

---

<div class="post-metadata">

**Author:** ![kvothe](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@kvothe](https://forums.suse.com/u/kvothe)\
**Post date:** [May 3, 2017, 10:47pm UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750/3 "2017-05-03T22:47:56Z")

</div>

`> sudo /usr/sbin/fdisk -l /dev/sda
Disk /dev/sda: 120 GiB, 128849018880 bytes, 251658240 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0x57830789
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 75489434 75487387 36G 83 Linux`

`> mount | grep sda
/dev/sda1 on / type ext4 (rw,relatime,data=ordered)`

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [May 3, 2017, 11:44pm UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750/4 "2017-05-03T23:44:07Z")

</div>

On 05/03/2017 01:54 PM, kvothe wrote:[color=blue]

> Code:  
> --------------------[color=green]  
> \> sudo /usr/sbin/fdisk -l /dev/sda[/color]  
> Disk /dev/sda: 120 GiB, 128849018880 bytes, 251658240 sectors  
> Units: sectors of 1 \* 512 = 512 bytes  
> Sector size (logical/physical): 512 bytes / 4096 bytes  
> I/O size (minimum/optimal): 4096 bytes / 4096 bytes  
> Disklabel type: dos  
> Disk identifier: 0x57830789  
> Device Boot Start End Sectors Size Id Type  
> /dev/sda1 \* 2048 75489434 75487387 36G 83 Linux  
> --------------------[/color]

That’s great; only the one partition, so in theory you should be able to  
grow it, and the filesystem within.  
[color=blue]

> Code:  
> --------------------[color=green]  
> \> mount | grep sda[/color]  
> /dev/sda1 on / type ext4 (rw,relatime,data=ordered)  
> --------------------[/color]

The only question remaining is whether or not this can be done, with ext4  
or even just the partition under it, while the system is running from that  
partition. I’m 99.999% sure you can do it if you were to boot from other  
media, but I do not know how you would do that with a Google Compute (or  
any other cloud) instance; if you can do it online, then try Yast’s  
Partitioner first:

```auto
sudo /sbin/yast disk
```

else, try ‘parted’.

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the  
forum as I do not use the web interface often.

---

<div class="post-metadata">

**Author:** ![kvothe](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@kvothe](https://forums.suse.com/u/kvothe)\
**Post date:** [May 4, 2017, 12:34am UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750/5 "2017-05-04T00:34:01Z")

</div>

I don’t think booting from other device is an option unfortunately. Here is what google says about [resizing](https://cloud.google.com/compute/docs/disks/add-persistent-disk).

[Resizing root disk.](https://cloud.google.com/compute/docs/disks/create-root-persistent-disks#resizingrootpd)

This is [the image](https://console.cloud.google.com/launcher/details/sap-public/sap-hana-express?project=hxe-project) that I used to create my system. The default on it was 36GB which I increased to 120 while creating my instance. But it still assigned 36 to root disk while keeping rest of it for itself. I followed the second link option and changed it to 125 GB but it still kept extra 5 gigs for itself 😃

---

<div class="post-metadata">

**Author:** ![ab1](https://avatars.discourse-cdn.com/v4/letter/a/d2c977/32.png) [@ab1](https://forums.suse.com/u/ab1)\
**Post date:** [May 4, 2017, 4:21pm UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750/6 "2017-05-04T16:21:27Z")

</div>

On 05/03/2017 03:44 PM, kvothe wrote:[color=blue]

> I don’t think booting from other device is an option unfortunately. Here  
> is what google says about ‘resizing’  
> ([https://cloud.google.com/compute/docs/disks/add-persistent-disk](https://cloud.google.com/compute/docs/disks/add-persistent-disk)).
> 
> ‘Resizing root disk.’  
> ([https://cloud.google.com/compute/docs/disks/create-root-persistent-disks#resizingrootpd](https://cloud.google.com/compute/docs/disks/create-root-persistent-disks#resizingrootpd))
> 
> This is ‘the image’  
> ([https://console.cloud.google.com/launcher/details/sap-public/sap-hana-express?project=hxe-project](https://console.cloud.google.com/launcher/details/sap-public/sap-hana-express?project=hxe-project))  
> that I used to create my system. The default on it was 36GB which I  
> increased to 120 while creating my instance. But it still assigned 36 to  
> root disk while keeping rest of it for itself. I followed the second  
> link option and changed it to 125 GB but it still kept extra 5 gigs for  
> itself :D[/color]

It sounds like you have it resized, but maybe not. If not, my next push  
would be to create a new persistent disk, mount it where you need it, and  
then use that going forward since, in my experience, this works better on  
all types of systems (physical virtual, etc.) since 99.9% of reasons to  
grow disks are application-specific, meaning they have their own  
directories where large data things reside (binary data like databases or  
VMs or images) and that is ideally suited to the flexibility that comes  
from mountpoints.

–  
Good luck.

If you find this post helpful and are logged into the web interface,  
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the  
forum as I do not use the web interface often.

---

<div class="post-metadata">

**Author:** ![kvothe](https://avatars.discourse-cdn.com/v4/letter/k/f475e1/32.png) [@kvothe](https://forums.suse.com/u/kvothe)\
**Post date:** [May 4, 2017, 5:19pm UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750/7 "2017-05-04T17:19:11Z")

</div>

I also think the resizing is done because when I use resize2fs it says the filesystem is already 9435923 blocks long which makes me think I just need to allocate more space to the partition somehow. I contacted google support and they ask me to use gcloud api command `gcloud compute disks resize `. But apparentlyresize is not a valid parameter 😛  
I have contacted them again and I will probably create another disk if need be. But this I assumed should have been easier than all the hoops I am jumping through specially when the instance was created with sufficient space to begin with.

Edit:  
I just saw [this page](https://cloud.google.com/compute/docs/disks/create-root-persistent-disks#resizingrootpd) . It lists the OS which support automatic resizing. Do you think SUSE is the reason its not happening?

---

<div class="post-metadata">

**Author:** ![frable90](https://avatars.discourse-cdn.com/v4/letter/f/df705f/32.png) [@frable90](https://forums.suse.com/u/frable90)\
**Post date:** [June 9, 2017, 8:08pm UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750/8 "2017-06-09T20:08:26Z")

</div>

[QUOTE=kvothe;37711][Resizing root disk.](https://cloud.google.com/compute/docs/disks/create-root-persistent-disks#resizingrootpd)

This is [the image](https://console.cloud.google.com/launcher/details/sap-public/sap-hana-express?project=hxe-project) that I used to create my system. The default on it was 36GB which I increased to 120 while creating my instance. But it still assigned 36 to root disk while keeping rest of it for itself. I followed the second link option and changed it to 125 GB but it still kept extra 5 gigs for itself :D[/QUOTE]

[QUOTE=kvothe;37717]I also think the resizing is done because when I use resize2fs it says the filesystem is already 9435923 blocks long which makes me think I just need to allocate more space to the partition somehow. I contacted google support and they ask me to use gcloud api command `gcloud compute disks resize `. But apparentlyresize is not a valid parameter 😛  
I have contacted them again and I will probably create another disk if need be. But this I assumed should have been easier than all the hoops I am jumping through specially when the instance was created with sufficient space to begin with.

Edit:  
I just saw [this page](https://cloud.google.com/compute/docs/disks/create-root-persistent-disks#resizingrootpd) . It lists the OS which support automatic resizing. Do you think SUSE is the reason its not happening?[/QUOTE]

I’m the exact same situation: SAP HANA Express image on GCE (Suse Enterprise). The automatic disk resizing does not work for it ([Suse is not supported by GCE](https://cloud.google.com/compute/docs/disks/create-root-persistent-disks#autoresize)). Did you find a solution to resize the boot/root (/) partition?

---

<div class="post-metadata">

**Author:** ![Jens-U](https://avatars.discourse-cdn.com/v4/letter/j/d78d45/32.png) [@Jens-U](https://forums.suse.com/u/Jens-U)\
**Post date:** [June 12, 2017, 2:15pm UTC](https://forums.suse.com/t/resizing-sda1-on-google-cloud-suse/29750/9 "2017-06-12T14:15:19Z")

</div>

HI frable90,

resize the partition to reach to the end of the disk, then reboot, then resize the file system.

Alternatively, switch to using more than one file system. You’d create additional partitions on the disk and use it for the additional file systems, or start using LVM for that (which I’d recommend anyhow, despite this being a cloud machine).

Regards,  
J
