Partition aus raw-disk mounten

steff123

Member
Aug 1, 2020
55
2
13
41
In einer VM ist das Root-FS vollgelaufen. Nutz ja Proxmox nur im privaten Umfeld. Wie kann ich denn die erste Partition aus dem raw-File mounten? Bekomme sonst die logs nicht gelöscht. Kann nicht mehr zu Root wechseln, wenn die VM läuft. Leider nicht aufgeschrieben


Code:
$ parted vm-3050-disk-0.raw
GNU Parted 3.4
Using /mnt/data/images/3050/vm-3050-disk-0.raw
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                         
Model:  (file)
Disk /mnt/data/images/3050/vm-3050-disk-0.raw: 21,5GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type      File system     Flags
 1      1049kB  15,1GB  15,1GB  primary   ext4            boot
 2      15,1GB  16,1GB  1022MB  extended
 5      15,1GB  16,1GB  1022MB  logical   linux-swap(v1)

(parted) unit s                                                         
(parted) print                                                         
Model:  (file)
Disk /mnt/data/images/3050/vm-3050-disk-0.raw: 41943040s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start      End        Size       Type      File system     Flags
 1      2048s      29456383s  29454336s  primary   ext4            boot
 2      29458430s  31455231s  1996802s   extended
 5      29458432s  31455231s  1996800s   logical   linux-swap(v1)

(parted)
 
Last edited:
Du solltest das recht einfach hinkriegen mit den folgenden cmds:

Code:
losetup /dev/loop0 image-file.raw
kpartx -a /dev/loop0

dann kannst du dir die partitionen ansehen mit:
Code:
ls /dev/mapper/loop0*

und dann ganz normal mounten (verzeichnis muss vorher existieren):

Code:
mount /dev/mapper/loop0p1 /mnt/mountpoint

Ganz wichtig ist, dass sonst nichts auf das Disk Image zugreift, sprich dass die VM ausgeschalten sein sollte. Sonst kann es zu einem korrupten Filesystem fuehren
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!