Sie müssen die Größe der Partitionen innerhalb der VM ändern. Sie sollten eine Live-Distribution auf einem USB-Stick verwenden, genau wie die virtuelle Maschine eine physische Maschine war. Setzen Sie den Stick ein, starten Sie die VM, und weisen Sie sie an, die Festplatte zu booten, und ändern Sie die Größe der Partition. Die Tatsache, dass Sie LVM verwenden, ändert nichts an diesem Plan.
Linux VirtualBox Guest muss alle virtuellen Laufwerke verfügbar machen (keine Momentaufnahmen)
Mit -modifyhd wurde der Speicherplatz auf einer VMDK von 20 auf 50 GB erhöht. Der Centos-Client nutzt dies jedoch nicht.
Bei einer früheren Frage, die die Größe der virtuellen Festplatte verdoppelt, ändert sich der fdisk -l-Bericht nicht direkt, da er Momentaufnahmen hatte. Wie in der Abbildung gezeigt, sind in diesem Fall keine Snapshots aktiv.
Hier sind Details von guest-os
fdisk -l
[root @ localhost ~] # fdisk -l
Disk /dev/sda: 56.3 GB, 56308531200 bytes 255 heads, 63 sectors/track, 6845 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000b625d Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 2611 20458496 8e Linux LVM Disk /dev/mapper/VolGroup-lv_root: 14.6 GB, 14638120960 bytes 255 heads, 63 sectors/track, 1779 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/VolGroup-lv_root doesn't contain a valid partition table Disk /dev/mapper/VolGroup-lv_swap: 6308 MB, 6308233216 bytes 255 heads, 63 sectors/track, 766 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/VolGroup-lv_swap doesn't contain a valid partition table
pvdisplay
[root@localhost ~]# pvdisplay --- Physical volume --- PV Name /dev/sda2 VG Name VolGroup PV Size 19.51 GiB / not usable 3.00 MiB Allocatable yes (but full) PE Size 4.00 MiB Total PE 4994 Free PE 0 Allocated PE 4994 PV UUID 68d5TH-51cq-VbiL-D0ki-Bz9E-BZj3-DqVNRd
df -k
[root@localhost ~]# df -k Filesystem 1K-blocks Used Available Use% Mounted on /dev/mapper/VolGroup-lv_root 14070560 12795616 560192 96% / tmpfs 4168992 76 4168916 1% /dev/shm /dev/sda1 495844 54226 416018 12% /boot /dev/sr0 58236 58236 0 100% /media/VBOXADDITIONS_4.2.16_86992
Mounts
[root@localhost ~]# mount /dev/mapper/VolGroup-lv_root on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw) /dev/sda1 on /boot type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) /dev/sr0 on /media/VBOXADDITIONS_4.2.16_86992 type iso9660 (ro,nosuid,nodev,uhelper=udisks,uid=500,gid=500,iocharset=utf8,mode=0400,dmode=0500)
Gerät: Datenträger nach ID
[root@localhost ~]# ll /dev/disk/by-id total 0 drwxr-xr-x 6 root root 120 Sep 29 07:11 .. drwxr-xr-x 2 root root 240 Sep 29 07:11 . lrwxrwxrwx 1 root root 10 Sep 29 07:11 dm-uuid-LVM-ZNoRaHmQP5Q0vOttkofYrMdrBe1ouy9gT5SiHgxSwJJcKcK25RRTAERfIffUtgBe -> ../../dm-0 lrwxrwxrwx 1 root root 10 Sep 29 07:11 dm-name-VolGroup-lv_root -> ../../dm-0 lrwxrwxrwx 1 root root 10 Sep 29 07:11 dm-uuid-LVM-ZNoRaHmQP5Q0vOttkofYrMdrBe1ouy9gO5Nd7kMVEqxxpnSc455XW5SGmOQeoaEZ -> ../../dm-1 lrwxrwxrwx 1 root root 10 Sep 29 07:11 dm-name-VolGroup-lv_swap -> ../../dm-1 lrwxrwxrwx 1 root root 9 Sep 29 07:11 scsi-SATA_VBOX_HARDDISK_VB34dd657d-2336283c -> ../../sda lrwxrwxrwx 1 root root 9 Sep 29 07:11 ata-VBOX_HARDDISK_VB34dd657d-2336283c -> ../../sda lrwxrwxrwx 1 root root 10 Sep 29 07:11 scsi-SATA_VBOX_HARDDISK_VB34dd657d-2336283c-part2 -> ../../sda2 lrwxrwxrwx 1 root root 10 Sep 29 07:11 ata-VBOX_HARDDISK_VB34dd657d-2336283c-part2 -> ../../sda2 lrwxrwxrwx 1 root root 10 Sep 29 07:11 scsi-SATA_VBOX_HARDDISK_VB34dd657d-2336283c-part1 -> ../../sda1 lrwxrwxrwx 1 root root 10 Sep 29 07:11 ata-VBOX_HARDDISK_VB34dd657d-2336283c-part1 -> ../../sda1
2 Antworten auf die Frage
Anstatt einen LiveCD-USB-Boot zu erstellen, ging ich direkt zu gparted. Ich konnte eine neue primäre Partition von 30 GB erstellen.
Was nicht so reibungslos verlief, war die Erkennung der neuen Partition. gparted berichtete, dass / dev / sda beschäftigt war. Auch nach dem Neustart dasselbe.
Aber Kommandozeile mkfs funktioniert nicht
mkfs.ext4 /dev/sda3
Lassen Sie uns das Laufwerk montieren:
[root@localhost ~]# mount /dev/sda3 /d -o noatime
Sieh dich um:
[root@localhost ~]# mount /dev/mapper/VolGroup-lv_root on / type ext4 (rw) proc on /proc type proc (rw) sysfs on /sys type sysfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) tmpfs on /dev/shm type tmpfs (rw) /dev/sda1 on /boot type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) /dev/sr0 on /media/VBOXADDITIONS_4.2.18_88780 type iso9660 (ro,nosuid,nodev,uhelper=udisks,uid=500,gid=500,iocharset=utf8,mode=0400,dmode=0500) /dev/sda3 on /d type ext4 (rw,noatime)
Um sicher zu sein, lassen Sie uns eine kleine Datei erstellen
[root @ localhost ~] # echo "gparted, mkfs und mount erfolgreich" >> / d / foo [root @ localhost ~] # cat / d / foo
gparted, mkfs, and mount successful
Verwandte Probleme
-
6
Virtualbox, VMware, KVM oder andere für Ubuntu-Virtualisierung?
-
4
So installieren Sie den GNOME-Desktop unter Linux (CENTOS)
-
2
Anschließen eines MIDI-Controllers an CentOS5
-
5
Wie kann ich VirtualBox mit zwei Monitoren gut spielen lassen?
-
3
Fallstricke von Windows XP Virtual Machines
-
2
Auf unbestimmte Zeit nach einer Domain suchen / warten
-
2
Sollte ich meine Ubuntu VM auf Virtual Box portieren?
-
2
Gibt es einen Leistungsunterschied zwischen den virtuellen Laufwerkformaten VMDK und VDI mit Virtual...
-
1
Verwenden einer VMWare-Appliance mit VirtualBox / Parallels
-
2
Virtual Box 3.0.2 Vernetzung