国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 操作系統 > 正文

Extended VM Disk In VirtualBox or VMware (虛擬機磁盤擴容)

2024-06-28 13:27:00
字體:
來源:轉載
供稿:網友
Extended VM Disk In VirtualBox or VMware (虛擬機磁盤擴容)

First, Clean VM all snapshot, and poweroff your VM.

vmdk:

vmware-vdiskmanager -x 16GB myDisk.vmdk

vdi:

VBoxManage modifyhd <absolute path to file> --resize <size in MB>

And now, go to guest OS to resize partition.

I have only one partition, and it's root partition.You can use LiveCD do this. However, You alse use fdisk and resize2fs, that support online mode.

fdisk /dev/sda

Delete old partition, and create new partition you want. Last, write to disk, reboot your VM. Then run:

resize2fs /dev/sda1

Now, you can check your partition size.

df -h

P.S.

I find Shell script onraspi-config. It's a script it is used for expand root filesystem on SD card.

#.......do_expand_rootfs() {  if ! [ -h /dev/root ]; then    whiptail --msgbox "/dev/root does not exist or is not a symlink. Don't know how to expand" 20 60 2    return 0  fi  ROOT_PART=$(readlink /dev/root)  PART_NUM=${ROOT_PART#mmcblk0p}  if [ "$PART_NUM" = "$ROOT_PART" ]; then    whiptail --msgbox "/dev/root is not an SD card. Don't know how to expand" 20 60 2    return 0  fi  # NOTE: the NOOBS partition layout confuses parted. For now, let's only   # agree to work with a sufficiently simple partition layout  if [ "$PART_NUM" -ne 2 ]; then    whiptail --msgbox "Your partition layout is not currently supported by this tool. You are PRobably using NOOBS, in which case your root filesystem is already expanded anyway." 20 60 2    return 0  fi  LAST_PART_NUM=$(parted /dev/mmcblk0 -ms unit s p | tail -n 1 | cut -f 1 -d:)  if [ "$LAST_PART_NUM" != "$PART_NUM" ]; then    whiptail --msgbox "/dev/root is not the last partition. Don't know how to expand" 20 60 2    return 0  fi  # Get the starting offset of the root partition  PART_START=$(parted /dev/mmcblk0 -ms unit s p | grep "^${PART_NUM}" | cut -f 2 -d:)  [ "$PART_START" ] || return 1  # Return value will likely be error for fdisk as it fails to reload the  # partition table because the root fs is mounted  fdisk /dev/mmcblk0 <<EOFpd$PART_NUMnp$PART_NUM$PART_STARTpwEOF  ASK_TO_REBOOT=1  # now set up an init.d scriptcat <</EOF > /etc/init.d/resize2fs_once &&#!/bin/sh### BEGIN INIT INFO# Provides:          resize2fs_once# Required-Start:# Required-Stop:# Default-Start: 2 3 4 5 S# Default-Stop:# Short-Description: Resize the root filesystem to fill partition# Description:### END INIT INFO. /lib/lsb/init-functionscase "$1" in  start)    log_daemon_msg "Starting resize2fs_once" &&    resize2fs /dev/root &&    rm /etc/init.d/resize2fs_once &&    update-rc.d resize2fs_once remove &&    log_end_msg $?    ;;  *)    echo "Usage: $0 start" >&2    exit 3    ;;esacEOF  chmod +x /etc/init.d/resize2fs_once &&  update-rc.d resize2fs_once defaults &&  if [ "$INTERACTIVE" = True ]; then    whiptail --msgbox "Root partition has been resized./nThe filesystem will be enlarged upon the next reboot" 20 60 2  fi}#......
View Code

[via]

[via]


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 佛学| 龙门县| 卓尼县| 乐亭县| 东明县| 海城市| 岚皋县| 马关县| 临泽县| 仪征市| 惠水县| 黄龙县| 务川| 东乡族自治县| 靖安县| 八宿县| 威信县| 资阳市| 新安县| 萨迦县| 抚州市| 曲松县| 金平| 山东省| 新竹县| 天门市| 山阳县| 甘德县| 旬邑县| 惠州市| 信宜市| 思茅市| 陆河县| 东宁县| 新龙县| 平湖市| 得荣县| 石楼县| 扶沟县| 梁平县| 资阳市|