Skip to content

Instantly share code, notes, and snippets.

@DarkAngelStrike
Last active February 4, 2016 17:44
Show Gist options
  • Save DarkAngelStrike/e9db82e1c1c8d11fb228 to your computer and use it in GitHub Desktop.
Save DarkAngelStrike/e9db82e1c1c8d11fb228 to your computer and use it in GitHub Desktop.
root@cloudshell:~$ gcloud compute instances create rh7 --image rhel-7 --zone us-central1-a --boot-disk-size 50GB --verbosity error
Created [https://www.googleapis.com/compute/v1/projects/xxxxxx/zones/us-central1-a/instances/rh7].
NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUS
rh7 us-central1-a n1-standard-1 xx.xxx.x.x xxx.xxx.xxx.xx RUNNING
root@cloudshell:~$ gcloud compute config-ssh
You should now be able to use ssh/scp with your instances.
For example, try running:
$ ssh rh7
root@cloudshell:~$ ssh rh7
Warning: Permanently added 'xxx.xxx.xxx.xx' (ECDSA) to the list of known hosts.
[darkphoenixstrike@rh7 ~]$ sudo su -
[root@rh7 ~]#
[root@rh7 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)
[root@rh7 ~]# lsblk -o NAME,UUID,MOUNTPOINT,FSTYPE
NAME UUID MOUNTPOINT FSTYPE
sda
└─sda1 690b5506-9327-4014-a0cf-80ba632779c5 / xfs
[root@rh7 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 50G 0 disk
└─sda1 8:1 0 10G 0 part /
[root@rh7 ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 10G 1.1G 9.0G 11% /
[root@rh7 ~]# curl -o fdisk.sh https://raw.githubusercontent.com/DarkAngelStrike/GoogleCloud/master/fdisk.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 6156 100 6156 0 0 27687 0 --:--:-- --:--:-- --:--:-- 27729
[root@rh7 ~]# chmod u+x fdisk.sh
[root@rh7 ~]#
[root@rh7 ~]# ./fdisk.sh
The device presents a logical sector size that is smaller than
the physical sector size. Aligning to a physical sector (or optimal
I/O) size boundary is recommended, or performance may be impacted.
Welcome to fdisk (util-linux 2.23.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): Selected partition 1
Partition 1 is deleted
Command (m for help): Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): Partition number (1-4, default 1): First sector (2048-104857599, default 2048): Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-104857599, default 104857599): Using default value 104857599
Partition 1 of type Linux and of size 50 GiB is set
Command (m for help): The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
Connection to xxx.xxx.xxx.xx closed by remote host.
Connection to xxx.xxx.xxx.xx closed.
root@cloudshell:~$ ssh rh7
Warning: Permanently added 'xxx.xxx.xxx.xx' (ECDSA) to the list of known hosts.
[darkphoenixstrike@rh7 ~]$ sudo su -
[root@rh7 ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 10G 1.1G 9.0G 11% /
[root@rh7 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 50G 0 disk
└─sda1 8:1 0 50G 0 part /
[root@rh7 ~]# ./fdisk.sh
meta-data=/dev/sda1 isize=256 agcount=4, agsize=655232 blks
= sectsz=512 attr=2, projid32bit=1
= crc=0 finobt=0
data = bsize=4096 blocks=2620928, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0 ftype=0
log =internal bsize=4096 blocks=2560, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
data blocks changed from 2620928 to 13106944
[root@rh7 ~]# df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 50G 1.1G 49G 3% /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment