[Pkg-iscsi-maintainers] Bug#691732: open-iscsi: umountiscsi.sh tries to umount / and /var

Dennis Leeuw D.Leeuw at umcutrecht.nl
Mon Oct 29 14:02:12 UTC 2012


We can make this a long discussion, but I rather not. I do not have the 
knowledge to tell you what might or might not happen and why. I can only 
tell you what went wrong and restarting the open-iscsi service, without 
a block device being present created a problem with a ro / filesystem. 
But actually that is not the important. What is important is that if no 
block device is present, the script does not end gracefully, with the 
provided change it does.

running without my change:
# /etc/init.d/open-iscsi restart
Unmounting iscsi-backed filesystems: Unmounting all devices marked 
_netdevDeactivating iSCSI volume groups: md3200_1  Volume group 
"md3200_1" not found
Cannot deactivate Volume Group md3200_1 ... (warning).
.
umount: /: device is busy.
         (In some cases useful info about processes that use
          the device is found by lsof(8) or fuser(1))
Could not unmount / ... (warning).
umount: /var: device is busy.
         (In some cases useful info about processes that use
          the device is found by lsof(8) or fuser(1))
Could not unmount /var ... (warning).
  failed!
invoke-rc.d: initscript umountiscsi.sh, action "stop" failed.
Couldn't unmount all iSCSI devices. Cannot stop iSCSI service ... failed!

Which is probably not very user friendly. It doesn't matter if my system 
get Read-Only or not.

With the following lines added:
if [ "${BLOCK_FILE}" = 
'/sys/devices/platform/host24/session20/target*/*:*/block/*' ]; then
         log_warning_msg "No block devices found for this host, nothing 
to do"
         return 1
fi

It ends more gracefully:
# /etc/init.d/open-iscsi restart
Unmounting iscsi-backed filesystems: Unmounting all devices marked 
_netdevDeactivating iSCSI volume groups: md3200_1  Volume group 
"md3200_1" not found
Cannot deactivate Volume Group md3200_1 ... (warning).
.
No block devices found for this host, nothing to do ... (warning).
invoke-rc.d: initscript umountiscsi.sh, action "stop" failed.
Couldn't unmount all iSCSI devices. Cannot stop iSCSI service ... failed!

open-iscsid is still running and a restart didn't happen, but that is 
another issue.

Greetings,

Dennis

On 10/29/2012 02:33 PM, Ritesh Raj Sarraf wrote:
> On Monday 29 October 2012 06:41 PM, Dennis Leeuw wrote:
>>>>
>>> Where is the patch? I can't see it in the email.
>>
>> The patch is incorporated in the attached umountiscsi.sh script. See 
>> the if statement under the :
>>
>> for BLOCK_FILE in $SESSION_DIR/target*/*\:*/block/*; do
>>
>> line.
>
> No. Please send diffs of the file. Use the diff command on the 
> original and the modified file. It is easier to read.
>
>>
>>>
>>>> Due to the fact that our system does not receive block devices from 
>>>> the iSCSI target, but it is logged in,
>>>> this means the the BLOCK_FILE contains the search string, 
>>>> since/block/  does not exist. It then tries to umount
>>>> everything, making the entire system read-only:(
>>>>
>>>> With the change I made in umountiscsi.sh this is not happening 
>>>> anymore.
>>> I can't buy that statement. umountiscsi.sh does not do a remount in 
>>> read-only mode. Typically, the file system is re-mounted read-only, 
>>> only when it senses that the underneath block device is mis-behaving.
>>>
>>> What is your block device underneath the / file system? Is it a 
>>> local disk?
>>
>> umountscsi.sh sets BLOCK_DEV to * after the if-statement I added, so 
>> it does umount *, and due to the fact that we have set remount ro on 
>> errors, it gets remounted ro is what I expect.
>
> No. Attempting to umount /, while it is mounted with 
> errors=remount-ro, does not trigger an event to remount it with flag 
> 'ro'. You cannot umount / because it will always be busy. You can 
> re-mount it read-only manually, but that is a different story.
>
> 20:10:46 root at debian-x64:~# cat /etc/fstab
> # /etc/fstab: static file system information.
> #
> # Use 'vol_id --uuid' to print the universally unique identifier for a
> # device; this may be used with UUID= as a more robust way to name devices
> # that works even if disks are added and removed. See fstab(5).
> #
> # <file system> <mount point>   <type> <options>       <dump>  <pass>
> proc            /proc           proc    defaults        0       0
> /dev/mapper/debian--x64-root /               ext3 errors=remount-ro 
> 0       1
> # /boot was on /dev/vda1 during installation
> UUID=baf61a3c-6af3-40c4-9430-6f252f6042ac /boot           ext2 
> defaults        0       2
> /dev/mapper/debian--x64-swap_1 none            swap sw              
> 0       0
> # /dev/hdc        /media/cdrom0   udf,iso9660 user,noauto 0       0
> /dev/cdrom        /media/cdrom0   udf,iso9660 user,noauto 0       0
> 192.168.122.1:/var/tmp/nfs      /var/tmp/nfs    nfs 
> _netdev,auto,soft,intr  0       0
> tmpfs           /tmp            tmpfs   auto    0       0
>
>
> 20:10:51 root at debian-x64:~# umount /
> umount: /: device is busy.
>         (In some cases useful info about processes that use
>          the device is found by lsof(8) or fuser(1))
>
> 20:10:53 root at debian-x64:~# mount
> /dev/mapper/debian--x64-root on / type ext3 (rw,errors=remount-ro)
> tmpfs on /lib/init/rw type tmpfs 
> (rw,nosuid,size=5242880,mode=755,size=5242880,mode=755)
> tmpfs on /run type tmpfs 
> (rw,noexec,nosuid,size=10%,mode=755,size=10%,mode=755)
> tmpfs on /tmp type tmpfs (rw,nosuid,nodev,size=20%,mode=1777)
> proc on /proc type proc (rw,noexec,nosuid,nodev)
> sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
> udev on /dev type tmpfs (rw,mode=0755)
> tmpfs on /run/shm type tmpfs 
> (rw,nosuid,nodev,size=20%,mode=1777,size=20%,mode=1777)
> devpts on /dev/pts type devpts 
> (rw,noexec,nosuid,gid=5,mode=620,gid=5,mode=620)
> /dev/vda1 on /boot type ext2 (rw)
> 192.168.122.1:/var/tmp/nfs on /var/tmp/nfs type nfs 
> (rw,soft,intr,addr=192.168.122.1)
> configfs on /sys/kernel/config type configfs (rw)
>
> 20:10:59 root at debian-x64:~# touch /test
>
> 20:11:04 root at debian-x64:~# file /test
> /test: empty
>
>>
>> To answer your question: the block device is indeed a local disk. 
>
> If your / goes read-only, it is your local block device at fault. 
> Could be a hardware problem, or else, a bug in the kernel. You should 
> check the kernel logs.
>
> -- 
> Ritesh Raj Sarraf
> RESEARCHUT -http://www.researchut.com
> "Necessity is the mother of invention."


-- 
ICT Medewerker
Divisie Biomedische Genetica
UMC Utrecht
Heidelberglaan 100 STR2.126
3584 CX  Utrecht
The Netherlands
06 27744048
intern: 64048


------------------------------------------------------------------------------

De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren. Het Universitair Medisch
Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de W.H.W.
(Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd bij
de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.

Denk s.v.p aan het milieu voor u deze e-mail afdrukt.

------------------------------------------------------------------------------

This message may contain confidential information and is intended exclusively
for the addressee. If you receive this message unintentionally, please do not
use the contents but notify the sender immediately by return e-mail. University
Medical Center Utrecht is a legal person by public law and is registered at
the Chamber of Commerce for Midden-Nederland under no. 30244197.

Please consider the environment before printing this e-mail.



More information about the Pkg-iscsi-maintainers mailing list