Mount has the option offset
to specify that a file system does not start at the beginning of a device but some specific amount of bytes after.
How can I use resize2fs
, which does not have that option, to resize such a file system which does not start at the device's beginning?
Linux – Using resize2fs with file system offset
filesystemslinuxresize2fs
Best Answer
The
offset
option ofmount
does not get passed to mount directly, but tolosetup
which sets up a loop device which refers to the offsetted location of the underlaying block device. Mount then performs its operations on that loop device rather than the raw block device itself.You can also use
losetup
to makeresize2fs
play which such file systems:(Example may not be complete in means of resize2fs operations)
losetup
searchs for the first free loop device (in that example /dev/loop0) as--find
was passed.--show
outputs that loop device to STDOUT.