CentOS img file of server I need to mount to extract filesystem

General support questions
Post Reply
redrum
Posts: 1
Joined: 2019/06/27 09:51:35

CentOS img file of server I need to mount to extract filesystem

Post by redrum » 2019/06/27 10:16:18

Hi, there .

I have a dd img of a CentOS server. I want to mount the image and extract the files for analysis. I have tried am getting errors in CentOS 7 Gnome. Does anyone know a way to do this? I get a loop error... Any other way to see easily an XFS file system.

dunch
Posts: 66
Joined: 2018/11/07 13:48:53
Location: Yorkshire

Re: CentOS img file of server I need to mount to extract filesystem

Post by dunch » 2019/06/27 13:37:47

You'll need to use an offset if you're mounting a single partition from a disk image. What does fdisk -l /path/to/image.img say?

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: CentOS img file of server I need to mount to extract filesystem

Post by TrevorH » 2019/06/27 15:46:30

If the disk image has a partition table on it then you need to first use losetup to make that accessible and then kpartx to add mappings for the partitions on /dev/loopX and then you can mount /dev/loopXp1 etc.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply