From: Yura Kalinichenko <yuk@kalina.in.ua>
To: ALT Linux Sisyphus discussions <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] Снова про монтирование
Date: Sat, 01 Mar 2008 21:31:11 +0200
Message-ID: <47C9AEFF.6030902@kalina.in.ua> (raw)
In-Reply-To: <200802192126.39418.mak@rsmu.ru>
[-- Attachment #1: Type: text/plain, Size: 4246 bytes --]
Hi!
Прежде всего хочу поблагодарить Michael A. Kangin за (наконец-то!)
простое и независимое от всяческих DM и FM решение задачи монтирования
сменных носителей. В общем все работает просто отлично, но у меня есть
несколько небольших правок. К сожалению, не нашел этого очень нужного
пакета в официальных репозитариях, посему нет возможности вешать патчи в
багзиллу, так что публикую их здесь.
1) если метка флешки содержит в себе пробельные символы (напр. у меня
точка монтировния обзывается "USB DISK") - то устройство не может
автоматически отмонтироваться. Лечится следующим патчем:
---------------hal-mount-fix_umount_space.patch--------------
diff -U 2 -r hal-mount-subfs-0.1.2.orig/mount-hal-fs hal-mount-subfs-0.1.2/mount-hal-fs
--- hal-mount-subfs-0.1.2.orig/mount-hal-fs 2008-03-01 14:06:56 +0200
+++ hal-mount-subfs-0.1.2/mount-hal-fs 2008-03-01 14:02:13 +0200
@@ -86,5 +86,5 @@
do_unmount() {
- MOUNT_POINT=$1
+ MOUNT_POINT="$1"
initlog -n $LOG_NAME -s "Trying unmount $MOUNT_POINT"
@@ -125,5 +125,6 @@
while MOUNT_LINE=`grep -m 1 "^$HAL_PROP_BLOCK_DEVICE " /proc/mounts`; do
- do_unmount "`echo $MOUNT_LINE |cut -f 2 -d ' '`"
+ set -- $MOUNT_LINE
+ do_unmount "`echo -e "$2"`"
done
----------------end of hal-mount-fix_umount_space.patch-------------
2) в многопользовательской системе монтировать носители с mode=0666,
IMHO, несколько некорректно. В качестве решения предлагаю использовать
для subfs опцию монтирования procuid, которая обеспечивает доступ по
принципу "кто первый встал (на точку монтирования) - того и тапки". Это
+ перекодирование имен файлов, исходя из предположения, что в системе (в
соответствии с генеральной линией партии) локаль UTF-8, а на vfat -
CP866 - делает второй патч:
---------------hal-mount-options.patch---------------------
diff -U 2 -r hal-mount-subfs-0.1.2.orig/99-submount-fs-options.fdi hal-mount-subfs-0.1.2/99-submount-fs-options.fdi
--- hal-mount-subfs-0.1.2.orig/99-submount-fs-options.fdi 2008-03-01 14:12:41 +0200
+++ hal-mount-subfs-0.1.2/99-submount-fs-options.fdi 2008-03-01 15:59:16 +0200
@@ -7,8 +7,8 @@
<match key="volume.policy.should_mount" bool="true">
<match key="volume.policy.mount_filesystem" string="subfs">
- <merge key="volume.policy.mount_options" type="string">nodev,nosuid,noexec,noatime</merge>
+ <merge key="volume.policy.mount_options" type="string">nodev,nosuid,noexec,noatime,procuid</merge>
<match key="volume.policy.mount_option.fs" string="vfat">
- <append key="volume.policy.mount_options" type="string">,fmask=0111,dmask=000,quiet</append>
+ <append key="volume.policy.mount_options" type="string">,iocharset=utf8,codepage=866,showexec</append>
</match>
@@ -18,5 +18,5 @@
<match key="volume.policy.mount_option.fs" string="iso9660">
- <append key="volume.policy.mount_options" type="string">,mode=0444,iocharset=koi8-r,ro</append>
+ <append key="volume.policy.mount_options" type="string">,iocharset=utf8,ro</append>
</match>
@@ -27,5 +27,5 @@
<merge key="storage.policy.mount_options" type="string">nodev,nosuid,noexec,noatime</merge>
<match key="storage.policy.mount_option.fs" string="floppyfss">
- <append key="storage.policy.mount_options" type="string">,fmask=0111,dmask=000,quiet,sync</append>
+ <append key="storage.policy.mount_options" type="string">,procuid,iocharset=utf8,codepage=866,showexec,quiet,sync</append>
</match>
</match>
---------------end of hal-mount-options.patch--------------
3) остается открытым вопрос по принудительному отмонтироваю флешек.
Проведенный эксперимент показал, что в случае FS типа vfat в принципе
достаточно выполнить sync и выдернуть флешку. Но как-то мне это не очень
нравится. К примеру, вдруг мне захочется отформатировать флешку в ext2 -
и что я буду иметь в результате ? Правильно, unclean filesystem. Ну и
при многопользовательском доступе будут проблемы.
Есть идеи ?
[-- Attachment #2: yuk.vcf --]
[-- Type: text/x-vcard, Size: 177 bytes --]
begin:vcard
fn:Yura Kalinichenko
n:Kalinichenko;Yura
email;internet:yuk@kalina.in.ua
tel;home:8-0432-465743
tel;cell:+38-067-5878302
x-mozilla-html:FALSE
version:2.1
end:vcard
next prev parent reply other threads:[~2008-03-01 19:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-02 18:57 Alexei V. Mezin
2007-09-04 8:36 ` Eugene Ostapets
2007-09-04 8:49 ` Alexei V. Mezin
2007-09-04 8:55 ` Eugene Ostapets
2007-09-04 10:26 ` Alexei V. Mezin
2007-09-04 12:46 ` Michael A. Kangin
2007-09-04 15:45 ` Alexei V. Mezin
2007-09-05 8:06 ` Michael A. Kangin
2007-09-16 19:13 ` Michael Shigorin
2008-02-19 0:02 ` Michael A. Kangin
2008-02-19 15:00 ` Евгений Терешков
2008-02-19 18:26 ` Michael A. Kangin
2008-03-01 19:31 ` Yura Kalinichenko [this message]
2008-03-01 19:45 ` Yura Kalinichenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47C9AEFF.6030902@kalina.in.ua \
--to=yuk@kalina.in.ua \
--cc=sisyphus@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Sisyphus discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
public-inbox-index sisyphus
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.sisyphus
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git