Difference between revisions of "CentOS 7.x Mount file or partitions of file as typically done for disks"

From Notes_Wiki
(Created page with "<yambe:breadcrumb>CentOS_7.x_file_system_management|File system management</yambe:breadcrumb> =CentOS 7.x Mount file or partitions of file as typically done for disks= ==kpar...")
 
m
 
Line 1: Line 1:
<yambe:breadcrumb>CentOS_7.x_file_system_management|File system management</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x system administration|System Administration]] > [[CentOS 7.x file system management|File system management]] > [[CentOS 7.x Mount file or partitions of file as typically done for disks]]
=CentOS 7.x Mount file or partitions of file as typically done for disks=


==kpartx==
==kpartx==
Line 35: Line 34:




<yambe:breadcrumb>CentOS_7.x_file_system_management|File system management</yambe:breadcrumb>
[[Main Page|Home]] > [[CentOS]] > [[CentOS 7.x]] > [[CentOS 7.x system administration|System Administration]] > [[CentOS 7.x file system management|File system management]] > [[CentOS 7.x Mount file or partitions of file as typically done for disks]]

Latest revision as of 06:44, 25 August 2022

Home > CentOS > CentOS 7.x > System Administration > File system management > CentOS 7.x Mount file or partitions of file as typically done for disks

kpartx

One option is to use Kpartx as it is straightforward and has been seen to work without any difficulty since quite some time.


losetup

Other option is to use 'losetup'

To use losetup see example given in 'man losetup' below:

         The following commands can be used as an example of using the loop device.
  
              # dd if=/dev/zero of=~/file.img bs=1024k count=10
              # losetup --find --show ~/file.img
              /dev/loop0
              # mkfs -t ext2 /dev/loop0
              # mount /dev/loop0 /mnt
               ...
              # umount /dev/loop0
              # losetup --detach /dev/loop0

That is, use

losetup --find --show -P <file-or-device>

if there are further partitions. Other option is to let device get created and then do

  partprobe /dev/loop1



Home > CentOS > CentOS 7.x > System Administration > File system management > CentOS 7.x Mount file or partitions of file as typically done for disks