Resizng data disk on Alicloud - disk

I have a production server running CentOS 6.9 on Alicloud in China. Instance is of ecs.sn1.3xlarge type. Recently one of my data disk became filled-up. So I decided to resize the volume and followed the step by step instructions available on this page: https://www.alibabacloud.com/help/doc-detail/25452.html.
Here are steps that I followed:
Resized disk form console
Rebooted system (Rebooting system didn't resized/populated disk on system)
umount disk
Run fdisk on desired disk
e2fsck -f /dev/vdb1 # check the file system
resize2fs /dev/vdb1 # resize the file system
Thank you in Advance

Related

MacOS Catalina read-write mount could not be mounted in single user or recovery mode with permission denied

I need to have writable access to the file system in recovery mode, but I always get the error
mount_apfs: volume could not be mounted: Permission denied.
I am aware of others who solved it like this: Read-only file system" with SIP disabled in macOS Catalina
i.e.:
start in recovery mode (Cmd-R at startup)
open terminal and disable SIP with csrutil disable
reboot into single user mode (Cmd-S at startup)
check SIP is disabled with csrutil status
try to mount the volumes with read/write:
sudo mount -uw /
sudo mount -uw /System/Volumes/Data
Neither of the two volumes can be mounted, I always get permission denied even with SIP disabled.
Interestingly, even if I boot the Mac from an external SSD (in this case an old Sierra installation) I cannot mount the disk as read/write.
Any further suggestions?
The problem in this case was a defect SSD, which switched into readonly mode after only 36 TB written, despite having a design of 1200 TBW.
Unfortunately, MacOS did not report this. When looking at System information > Storage > my SSD > SMART status the system still showed "Verified", which is supposed to mean that everything is ok.
It was not.
I determined this by installing smartmontools and running a check:
brew install smartmontools
smartctl -a disk1
it showed e.g.:
SMART overall-health self-assessment test result: FAILED
- Available spare has fallen below threshold
- media has been placed in read-only mode
- Data Units Written: ... 35,4 TB
- Available Spare: 1%
- Available Spare Threshhold: 10%
So issues
bad luck with SSD
bad error reporting by MacOS

Resize Virtualbox Ubuntu VM storage not taking effect

I followed these instructions to resize my VirtualBox Ubuntu VM on Mac:
http://osxdaily.com/2015/04/07/how-to-resize-a-virtualbox-vdi-or-vhd-file-on-mac-os-x/
This is after the change:
*****-M-D2KA:$ VBoxManage showhdinfo ~/VirtualBox\ VMs/P4_Runtime/P4_Runtime.vdi
UUID: ce0ccd77-f265-46cd-9679-e25e64f1c992
Parent UUID: base
State: locked read
Type: normal (base)
Location: /Users/*****/VirtualBox VMs/P4_Runtime/P4_Runtime.vdi
Storage format: VDI
Format variant: dynamic default
Capacity: 25000 MBytes
Size on disk: 9967 MBytes
Encryption: disabled
In use by VMs: P4_Runtime (UUID: 5ea52b11-997f-45d8-b7d6-effa37a3b649) [Snapshot 1 (UUID: 409c1035-2134-4532-a931-a29018d33dc6)]
Child UUIDs: 540ae750-5307-44ef-a313-95134ae353b7
165fe99e-490d-4dd9-9602-00e3aaa8f82c
But for some reason, it does not seem to take effect:
This is the "df -k" output in the VM, and I get "No space left on device" error:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda 10253588 9713020 0 100% /
What am I missing?
I found out what I missed. I used gparted to resize the partition.
Resizing the VHD doesn't change the size of the partition /dev/sda. You can run lsblk inside the guest to see the additional space. To get the extra space that is available in the guest OS, you may
Use something like gparted as mentioned here. Instructions to do that on VHD can be found here. Note that this might not be easiest, but you may be forced to if you plan to not move some of your mount points (Example if you're not ready to move /home/ to a new partition).
Or, create a new partition, again instructions on how to do is present here. I would prefer this option over the first.

More swap space for Docker on Mac OSX Yosemite

I am trying to add more swap space in docker in order to avoid this error installing oracle database:
This system does not meet the minimum requirements for swap space.
Based on the amount of physical memory available on the system, Oracle
Database 11g Express Edition requires 2048 MB of swap space. This
system has 1023 MB of swap space. Configure more swap space on the
system and retry the installation.
I am following the instructions commented here:
https://forums.docker.com/t/docker-for-mac-configure-swap-space/20656/2
but when I execute mkswap I get "command not found":
mkswap /var/swap.file
Any idea?
Docker for Mac runs an Alpine Linux VM to host containers.
This is a prebuilt boot image that is designed for ease of use, and also updates over time so it can be hard to customise some times as most config is reset when you reboot it.
In this case you can persist a swap file change, but config like this has the possibility of changing between versions without notice. You might be better off running a custom VM for this so your swap configuration hangs around.
Docker for Mac 17.06.0
Swap is controlled by the do_swapfile function in the /etc/init.d/automount init script in the VM. If the swap file exists, it will be used as is. As the swap file is stored in /var it is persisted across reboots and can be manually customised.
Attach to the VM's tty from your mac with screen (brew install screen if you don't have it)
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
Then in the VM, replace the existing swap file with a new one of the required size and reboot the box. The size of the file is the block size bs * count.
swapoff -a
dd if=/dev/zero of=/var/spool/swap bs=1k count=2097152
chmod 600 /var/spool/swap
mkswap /var/spool/swap
reboot
When the VM has rebooted, you should be able to connect again and see the new size of the VM's Swap space with free.
$ screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
/ # free
total used free shared buffers cached
Mem: 3526164 389952 3136212 165956 20968 208160
-/+ buffers/cache: 160824 3365340
Swap: 2097148 0 2097148

custom Linux kernel build failure in vmware workstation

While trying to compile/build and boot custom kernel inside vmware workstation, while booting new kernel, it fails and falls to shell with error "failed to find disk by uuid".
I tried this with both ubuntu and centos.
Things I tried but didn't help
check mapping by uuid in boot entry and existence in directory.
initramfs-update
replaced root=uuid=<> with /dev/disk/sda3
is it issue with vmware workstation?
how can it be rectified..??
I had a similar fault with my own attempts to bootstrap Fedora 22 onto a blank partition using a Centos install on another partition. I never did solve it completely, but I did find the problem was in my initrd rather than the kernel.
The problem is the initrd isn't starting LVM because dracut didn't tell the initrd that it needs LVM. Therefore if you start LVM manually you should be able to boot into your system to fix it.
I believe this is the sequence of commands I ran from the emergency shell to start LVM:
vgscan
vgchange -ay
lvs
this link helped me remember
Followed by exit to resume normal boot.
You might have to mount your LVM /etc/fstab entries manually, I don't recall whether I did or not.
Try this:
sudo update-grub
Then:
mkinitcpio -p linux
It won't hurt to check your fstab file. There, you should find the UUID of your drive. Make sure you have the proper flags set in the fstab.
Also, there's a setting in the grub.cfg that has has GRUB use the old style of hexadecimal UUIDs. Check that out as well!
The issue is with creation of initramfs, after doing a
make oldconfig
and choosing default for new options, make sure the ENOUGH diskspace is available for the image to be created.
in my case the image created was not correct and hence it was failing to mount the image at boot time.
when compared; the image size was quite less than the existing image of lower version, so I added another disk with more than sufficient size and then
make bzImage
make modules
make modules_install
make install
starts working like a charm.
I wonder why the image creation got completed earlier and resulted in corrupt image (with less size) without throwing any error [every single time]

Openstack - Windows images based on qcow2 file starts 80% full? Resizing is not working?

I am trying to set up a Windows 7 instance on Openstack. This instance requires at least 50 GB of free disk space to run an application. When I create my windows 7 image and upload it everything works fine, except for one problem - The disk space is already 80% used when I start.
For example a windows 7 instance with a 100GB hard drive has only 18.3GB of free space.
What I tried:
I have been trying to create a windows 7 image with a 100GB hard drive. I created a QCOW2 file with a windows 7 ISO and the Virt-IO drivers ISO using the below commands:
create the empty qcow2 file:
qemu-img create -f qcow2 win_64bit_SP1_100GB.qcow2 100G
Combine the two ISOs:
sudo virt-install --connect qemu:///system --name
PS4Agent_win7_64bit_SP1_100GB --ram 2048 --vcpus 2 --network
network=default,model=virtio --disk
path=win_64bit_SP1_100GB.qcow2,format=qcow2,device=disk,bus=virtio
--cdrom /home/khennessy/win7_win8_iso_creation/SW_DVD5_Win_Pro_7w_SP1_64BIT_English_-2_MLF_X17-59279.ISO
--disk path=/home/khennessy/win7_win8_iso_creation/virtio-win-0.1-100.iso,device=cdrom
--vnc --os-type windows --os-variant win2k8 --force
I then uploaded these to Openstack using a 'minimum disk space' of 90GB, making the minimum flavor xl. (Currently trying a lower value, the images are so large it takes a long time to test anything.)
I then create an instance using this image and log into it using the 'console' view. It all works fine but when I go into 'my computer' it tells me I have only 18GB free space? I have tried 'resizing' the images but it just seems to bring them into an error state?
Can anyone help me? Thanks very much.
Before you upload your windows 7 image onto glance, you need to download CloudbaseInitSetup_x64.msi
or CloudbaseInitSetup_x86.msi] and install it on your windows7 image first. Also, don't forget to add "plugins=cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin" to the configuration file of Cloudbase-init.
You can visit and http://cloud-ninja.org/2014/05/14/running-windows-7-guests-on-openstack-icehouse/ for more information.

Resources