( kroozo | 2014. 02. 02., v – 13:22 )

Móriczkáztam egy kicsit hirtelen. (azért dd, mert valami elejtett megjegyzés az mkudffst azzal vádolta, hogy sparse fileokat csinál, ami majd úgy nő, ahogy igény van rá)

#!/bin/bash
echo "###creating test file:"
dd if=/dev/zero of=/tmp/test.udf bs=2048 count=10000
sha1sum /tmp/test.udf 
mkudffs --media-type=dvd /tmp/test.udf 10000
sha1sum /tmp/test.udf
echo
echo "###testing with default options:"
mount -o loop /tmp/test.udf /mnt
mount|grep test
echo "##Trying to add file"
echo 'test' > /mnt/testfile.txt
umount /tmp/test.udf 
sha1sum /tmp/test.udf 
echo
echo "###testing with explicit ro:"
mount -o loop,ro /tmp/test.udf /mnt
mount|grep test
echo "##Trying to add file"
echo 'test' > /mnt/testfile.txt
umount /tmp/test.udf 
sha1sum /tmp/test.udf 
echo

echo "###testing with explicit rw:"
mount -o loop,rw /tmp/test.udf /mnt
mount|grep test
echo "##Trying to add file"
echo 'test' > /mnt/testfile.txt
umount /tmp/test.udf 
sha1sum /tmp/test.udf 
echo

rm -f /tmp/test.udf

CentOS 6.4

###creating test file:
10000+0 records in
10000+0 records out
20480000 bytes (20 MB) copied, 0.0912135 s, 225 MB/s
21eac8f53c5e2ed9ae09ccebf2cf7a0261efb8f0 /tmp/test.udf
start=0, blocks=16, type=RESERVED
start=16, blocks=3, type=VRS
start=19, blocks=237, type=USPACE
start=256, blocks=1, type=ANCHOR
start=257, blocks=16, type=PVDS
start=273, blocks=1, type=LVID
start=274, blocks=9469, type=PSPACE
start=9743, blocks=1, type=ANCHOR
start=9744, blocks=239, type=USPACE
start=9983, blocks=16, type=RVDS
start=9999, blocks=1, type=ANCHOR
295f49ebb4b751179dc4aaacd18f5f2d13f02abc /tmp/test.udf

###testing with default options:
/tmp/test.udf on /mnt type udf (rw,loop=/dev/loop0)
##Trying to add file
./test.sh: line 12: /mnt/testfile.txt: Read-only file system
295f49ebb4b751179dc4aaacd18f5f2d13f02abc /tmp/test.udf

###testing with explicit ro:
/tmp/test.udf on /mnt type udf (ro,loop=/dev/loop0)
##Trying to add file
./test.sh: line 20: /mnt/testfile.txt: Read-only file system
295f49ebb4b751179dc4aaacd18f5f2d13f02abc /tmp/test.udf

###testing with explicit rw:
/tmp/test.udf on /mnt type udf (rw,loop=/dev/loop0)
##Trying to add file
./test.sh: line 29: /mnt/testfile.txt: Read-only file system
295f49ebb4b751179dc4aaacd18f5f2d13f02abc /tmp/test.udf

Ubuntu saucy vagy mi a szösz

###creating test file:
10000+0 records in
10000+0 records out
20480000 bytes (20 MB) copied, 0.0875486 s, 234 MB/s
21eac8f53c5e2ed9ae09ccebf2cf7a0261efb8f0 /tmp/test.udf
start=0, blocks=16, type=RESERVED
start=16, blocks=3, type=VRS
start=19, blocks=237, type=USPACE
start=256, blocks=1, type=ANCHOR
start=257, blocks=16, type=PVDS
start=273, blocks=1, type=LVID
start=274, blocks=9469, type=PSPACE
start=9743, blocks=1, type=ANCHOR
start=9744, blocks=239, type=USPACE
start=9983, blocks=16, type=RVDS
start=9999, blocks=1, type=ANCHOR
80b2bdd8ee523e4f0626737c6fa414e3de777aae /tmp/test.udf

###testing with default options:
mount: block device /tmp/test.udf is write-protected, mounting read-only
/tmp/test.udf on /mnt type udf (ro)
##Trying to add file
/home/user/test.sh: line 12: /mnt/testfile.txt: Read-only file system
75d8f7c00494eab728a146fcc404009bd39e6df4 /tmp/test.udf

###testing with explicit ro:
/tmp/test.udf on /mnt type udf (ro)
##Trying to add file
/home/user/test.sh: line 20: /mnt/testfile.txt: Read-only file system
75d8f7c00494eab728a146fcc404009bd39e6df4 /tmp/test.udf

###testing with explicit rw:
mount: block device /tmp/test.udf is write-protected, mounting read-only
/tmp/test.udf on /mnt type udf (ro)
##Trying to add file
/home/user/test.sh: line 29: /mnt/testfile.txt: Read-only file system
293b44fee384092087a50f2d5df186347a9408a2 /tmp/test.udf

Nem értem, hogy a centos miért mondja, hogy rw mountolt, miközben nem, de legalább konzekvensen tényleg nem nyúl hozzá. Az ubuntu láthatóan rw próbál mountolni, és úgy fest, hogy miközben a mount megszüli, hogy ez ro, aközben valamit csinál, amit nem kéne.