mircea-vutcovici / scripts Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
Test growpart
instead of parted
.
https://www.systutorials.com/docs/linux/man/1-growpart/
http://manpages.ubuntu.com/manpages/cosmic/man1/growpart.1.html
After increasing a qemu disk, the script is not asking the SCSI subsytem to resize it.
[root@localhost ~]# virsh blockresize mytestvm vda 51G
Block device 'vda' is resized
mvutcovi@mytestvm:~$ sudo bash vol_resize.sh --block-device /dev/vda1
sfdisk -d /dev/vda > dev_vda-partition-table-$(date +%F_%H%M%S).txt # Backup MS-DOS partition table for /dev/vda block device.
parted -s /dev/vda resizepart 1 # Resize MS-DOS partition /dev/vda1
# Update kernel with new partition table from disk
partx -u /dev/vda
partprobe /dev/vda
blockdev --rereadpt /dev/vda
kpartx -u /dev/vda
resize2fs /dev/vda1 # Resize ext3 or ext4 filesystem
mvutcovi@mytestvm:~$
When resizing a SD card, the script fails with the following trace:
2023-08-16 03:23:14 DEBUG: Debug enabled from command line.
2023-08-16 03:23:15 DEBUG: Expanding /dev/mmcblk0 --> /dev/mmcblk0. Command: "dmsetup deps /dev/mmcblk0" returns "Device mmcblk0 not found
Command failed."
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" aka "/dev/mmcblk0" device is a MD device and resize it.
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" is a MS-DOS or UEFI GPT partition.
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" aka "/dev/mmcblk0" device is a SCSI device and rescan it.
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" aka "/dev/mmcblk0" device is a NVME device and rescan it.
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" aka "/dev/mmcblk0" device is a Virtio block device.
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" aka "/dev/mmcblk0" device is DM multipath.
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" aka "/dev/mmcblk0" device is DM crypt.
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" aka "/dev/mmcblk0" device is LVM2 logical volume.
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" aka "/dev/mmcblk0" device is a loop volume.
2023-08-16 03:23:15 DEBUG: Check if "/dev/mmcblk0" aka "/dev/mmcblk0" is a file.
2023-08-16 03:23:15 FATAL: The type of the "/dev/mmcblk0" device could not be determined. Stack trace:
./vol_resize.sh:45 log
./vol_resize.sh:50 die
./vol_resize.sh:253 expand_block_device
./vol_resize.sh:519 main
vol_resize.sh can generate a command like:
parted -s /dev/sdd resizepart 2 # Resize MS-DOS partition /dev/sdd2
Even if the version of parted
installed on the machine is not supporting this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.