権限のないユーザーがsudoを使用せずにLinuxでUDFファイルシステムを読み取ってマウントする方法はありますか?

権限のないユーザーがsudoを使用せずにLinuxでUDFファイルシステムを読み取ってマウントする方法はありますか?

Linuxサーバーでノードをリースしています。

uname -a
Linux 5.15.112-gentoo #2 SMP x86_64 AMD 64-Core Processor Authentic AMD GNU/Linux

テナントとして、私は基本的にスーパーユーザーになることはできず、sudo.ISO形式で保存されたUDFファイルシステムを読み取ってマウントする必要があります。

コマンドのオプションとしてヒューズISOを見ました。

fuseiso ~/files/iso.iso ~/mountpoint

ISO9660ただし、UDF以外の形式のみを処理しているようです。だからそれを使用しようとすると、多くのエラーメッセージが表示されますfuseiso

.isoまた、インストールせずにUDFを読み、内容をエクスポートするためのツールがあるかもしれないと思いました。

研究が進行中です。もし提案する方はいらっしゃいますか?

ベストアンサー1

udfclientたとえば、「欠落しているマンページ」というユーティリティセットがあります。ダーバンアーキテクチャLinuxまたはFreeBSDホームページとソースhttps://www.13thmonkey.org/udfclient/。 Gentoo用にパッケージ化されているかどうかにかかわらず、システムへのアクセス権を持たない単純なユーザーとして、とにかくコンパイルまたはバイナリをコピーする必要があります。

$ udfclient 
Usage: udfclient [options] devicename [devicename]*)
-u level    UDF system verbose level
-r range    use only selected sessions like -3,5,7 or 6-
-W      allow writing (temporary flag)
-F      force mount writable when marked dirty (use with cause)
-b blocksize    use alternative sectorsize; use only on files/discs
-D      debug/verbose SCSI command errors
-s      byteswap read sectors (for PVRs)

明示的に明示されていないが、udfclientUDFファイルシステムイメージを受け入れます。〜のようにデバイス名、実際のDVDデバイスではありません。最初から完全な例:

$ truncate -s $((32 * 2**20)) /tmp/udf.img
$ newfs_udf -L myudf /tmp/udf.img
Opening device /tmp/udf.img

UDF device /tmp/udf.img is a regular file
    bufcache thread initialising


Disc info for disc in device /tmp/udf.img
    MMC profile        : Unknown[0] profile
    sequential         :  no
    recordable         : yes
    erasable           :  no
    blankable          :  no
    formattable        :  no
    rewritable         : yes
    mount raineer      :  no

[...]

Closing logical volume `64f5db204864e7f7`:`0019a2bf`:`myudf`
    wait for syncing disc to idle
    stopping bufcache thread
    bufcache thread joining
    signal disc its finished with writing
    wait for final disc idling
    close device
Disc access statistics
    sector reads          1  (0 Kbyte)
    sector written       91  (45 Kbyte)
    switches              3
$ cd /tmp
$ udfclient udf.img 
    bufcache thread initialising
Opening device udf.img
UDF device udf.img is a regular file

UDF Dump of disc in device udf.img
UDF sessions : Yes 

Start mounting
    retrieving volume space

[...]

Directory listing of /
drwxrwxrwx     -1     -1          40  64f5db204864e7f7:0019a2bf:myudf:fileset
UDF working directory is     /
Current FS working directory /tmp
UDF> 

udfclientUDFファイルシステムのルートはインタラクティブモードではマッピングされません。/これcdをまず行う必要があります。例:

UDF> help
Selected commands available (use " pair for filenames with spaces) :
ls  [file | dir]    lists the UDF directory
cd  [dir]       change current UDF directory
lcd [dir]       change current directory
lls         lists current directory
pwd         display current directories
free            display free space on disc
get  source [dest]  retrieve a file / directory from disc
mget (file | dir)*  retrieve set of files / directories
put  source [dest]  write a file / directory to disc
mput (file | dir)*  write a set of files / directories
trunc file length   trunc file to length
mkdir dir       create directory
rm  (file | dir)*   delete set of files / directories
mv  source dest     rename a file (limited)
sync            sync filingsystem
quit            exits program
exit            alias for quit
UDF> ls
Directory listing of /
drwxrwxrwx     -1     -1          84  64f5db204864e7f7:0019a2bf:myudf:fileset
UDF> free
Can only report free space in UDF mountpoints
UDF> cd 64f5db204864e7f7:0019a2bf:myudf:fileset
UDF working directory is     /64f5db204864e7f7:0019a2bf:myudf:fileset
Current FS working directory /tmp
UDF> free
Logical volume  `myudf`
    physical partition 0
            9934 K (19869 pages) size
            9930 K (19861 pages) unallocated
               0 K (0 pages) freed

    Confirmed free space        9930 Kb ( 99 %) (    9.70 Mb) ( 0.01 Gb)
    Awaiting allocation            0 Kb (  0 %) (    0.00 Mb) ( 0.00 Gb)
    Estimated free space        9930 Kb ( 99 %) (    9.70 Mb) ( 0.01 Gb)
    Estimated total used           4 Kb (  0 %) (    0.00 Mb) ( 0.00 Gb)

    Total size                  9934 Kb (100 %) (    9.70 Mb) ( 0.01 Gb)
UDF> 

コマンドに加えて、udfclientファミリは次のような他のツールも提供します。newfs_udf上記の例では、UDF ファイルシステムを作成します。コマンドにパイプすることはできますが、udfclient各コマンドの後に提供されるすべての追加情報を削除する方法がないため、良いスクリプトの可能性は容易ではないようです。したがって、何をすべきかを事前に知っておく必要があります。

書き込みテスト((オプション-W)の使用とカーネルのUDFファイルシステムの実装を使用してUDFイメージをマウントしてrootとして検証中に破損が検出されたため、UDFイメージの読み取り中にこのツールを使用しないことをお勧めします。書く画像に。これには、ファイルシステムが元々作成された方法(さまざまなオプションが利用可能)が重要になる可能性があります。

名前の異なるスイートudftoolsmkudffsUDFファイルシステムを生成するための代替コマンドを提供します。また、sと同等の機能をwrudf提供する必要があるコマンドも提供していますudfclientが、UDFで動作するように管理できませんでした。:実際のハードウェアを見たいと思います。

おすすめ記事