Code Monkey home page Code Monkey logo

scripts's People

Contributors

mircea-vutcovici avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ambakshi

scripts's Issues

vol_resize.sh - not resizing the SD devices for qemu/KVM

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:~$ 

vol_resize.sh - fails to resize mmcblk block devices

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.