Score:0

Disk Partitioning errors after Disk resize in Compute Engine

sr flag

Currently stuck trying to partition disk. Getting some errors I don't understand. Might be in over my head. My question is at bottom.

The disk has been resized using GCP/Compute Engine Disk manager. from 80 to 200

While trying to partition the space using this guide, I hit a snag that's freaking me out eg;

[brentfm@whm ~]$ df -h /dev/sdb
df: ‘/dev/sdb’: No such file or directory
[brentfm@whm ~]$ df -h /dev/sdb1
df: ‘/dev/sdb1’: No such file or directory
[brentfm@whm ~]$ df -h /dev/sdb2
df: ‘/dev/sdb2’: No such file or directory

Now I'm concerned. Here's what I did and where I'm at:

(parted) sudo resize2fs /dev/sda1^Z                                       
[1]+  Stopped                 sudo parted /dev/sda
[brentfm@whm ~]$ sudo df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
devtmpfs       devtmpfs  2.6G     0  2.6G   0% /dev
tmpfs          tmpfs     2.6G  8.0K  2.6G   1% /dev/shm
tmpfs          tmpfs     2.6G  273M  2.4G  11% /run
tmpfs          tmpfs     2.6G     0  2.6G   0% /sys/fs/cgroup
/dev/sda2      xfs        80G   75G  5.4G  94% /
/dev/sda1      vfat      200M   12M  189M   6% /boot/efi
/dev/loop0     ext4      2.5G   16M  2.3G   1% /tmp
tmpfs          tmpfs     531M     0  531M   0% /run/user/1002
[brentfm@whm ~]$ sudo lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0  200G  0 disk 
├─sda1   8:1    0  200M  0 part /boot/efi
└─sda2   8:2    0 79.8G  0 part /
loop0    7:0    0  2.5G  0 loop /home/virtfs/bigislandfun/var/tmp
[brentfm@whm ~]$ resizepart

Usage:
 resizepart <disk device> <partition number> <length>
Options:
 -h, --help     display this help and exit
 -V, --version  output version information and exit
For more details see resizepart(8).
[brentfm@whm ~]$ sudo parted /dev/sda2
GNU Parted 3.1
Using /dev/sda2
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resizepart                                                       
Partition number? 2                                                       
Error: Partition doesn't exist.
(parted) resizepart                                                       
Partition number? 1                                                       
End?  [85.7GB]? quit                                                      
Error: Invalid number.
(parted) resizepart                                                       
Partition number? 2                                                       
Error: Partition doesn't exist.
(parted) resizepart                                                       
Partition number? 1                                                       
End?  [85.7GB]? 100%                                                      
(parted) quit                                                             
Information: You may need to update /etc/fstab.

[brentfm@whm ~]$ sudo sgdisk --move-second-header /dev/sda                
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
[brentfm@whm ~]$ sudo partprobe /dev/sda
[brentfm@whm ~]$ sudo xfs_growfs -d /
meta-data=/dev/sda2              isize=512    agcount=17, agsize=1297792 blks
         =                       sectsz=4096  attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=20919820, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=4096  sunit=1 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data size unchanged, skipping
[brentfm@whm ~]$ df -h /dev/sdb
df: ‘/dev/sdb’: No such file or directory
[brentfm@whm ~]$ df -h /dev/sdb1
df: ‘/dev/sdb1’: No such file or directory
[brentfm@whm ~]$ df -h /dev/sdb2
df: ‘/dev/sdb2’: No such file or directory
[brentfm@whm ~]$

Question: Am I screwed? Should I reboot server or run more commands? If anyone could share a KB article or a few steps to resolve this I would be eternally grateful. I'm not sure how bounties work here but I would also be willing to pay for a solution. Many thanks!

John Hanley avatar
cn flag
1) Did you create snapshots or images of your disk(s) before starting this procedure? 2) Which disk did you resize in the Google Cloud Console? 3) The first disk is **/dev/sda**. The second disk is **/dev/sdb**. 4) Partitions append numbers, for example, **/dev/sda1** is the first partition. 5) If you do not understand device naming, I would stop. You can **easily** destroy data. 6) If you resized the first disk in the console, then the resize of the partition table should be automatic. 7) The question is what do you need to resize and why. That will determine the steps.
Brent Norris avatar
sr flag
Thank you John, 1) Yes 2) It looks like I didn't resize any disk in web host manager. Yet Disk in Compute Engine sees the new 200gb size. Properties in Type Standard persistent disk Size 200 GB Zone us-west4-b 3) sbd only appeared when I got freaked out and left the console. 4) Got it... 5) I have some understanding of device naming, port naming etc. 6) Thank you... 7) The question is what do you need to resize and why. I wanted to resize /dev/sda2 from 80G to 200gb
John Hanley avatar
cn flag
Is there another partition located after /dev/sda2? If so, you must first move that partition to make room to expand sda2. If there is consecutive empty space after sda2 then you can resize the partition to occupy the unused space. Once that is complete, you can then resize the file system located in sda2. I would practice on a test system first so that you understand how to use the commands. Mistakes mean data loss. Another item is how is the disk partitioned - MBR, LVM, GPT, etc. As I said if you do not know what you are doing, stop.
Brent Norris avatar
sr flag
Thank you again John, yeah, it looks like I'm not going to be able to do this without an example. I "think" I know what to do but I just can't follow the Google documentation as clearly as I would like. I've hired this out before on Fiverr but I may have gotten lucky the first time. Can you recommend anyone to resize the disk for me? Do you do this kind of work?
Brent Norris avatar
sr flag
Thank you again John, this issue has been resolved. I really appreciate your help!
John Hanley avatar
cn flag
What was the solution?
Brent Norris avatar
sr flag
Thanks for asking.
Brent Norris avatar
sr flag
Thanks for asking. IT magic happened: 1. I decided to buy more space. So I added another 100gb in Disk (now 300gb) 2. Then I took a fresh look using df -th and lsblk. The partition of the boot disk had been restored to its original size. Feeling safer, I sought help on fiverr. 3. The Fiverr gig never started. 4. The next day the partition was correctly sized. Everything was somehow fixed. Literally, no one else had or has access to the server. It seems like adding 100gb did nothing but adding another 100gb caused the partition to be created automatically overnight while I slept. Magic?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.