Ticket #1357 (reopened defect)

Opened 4 years ago

Last modified 4 years ago

Don't automount all the volumes at startup

Reported by: erikos Owned by: tomeu
Priority: Immediate Milestone: 0.86
Component: sugar Version: 0.84.x
Severity: Major Keywords:
Cc: Distribution/OS: Unspecified
Bug Status: Assigned

Description

Currently, the code in extensions/deviceicon/volume.py tries to automount all the available volumes at startup (for volume in volume_monitor.get_volumes()).

This includes all the partitions of my disk, if in /etc/fstab or not.

We can not remove the automount at startup since a user may have inserted a removable device, but we should refine that part of the code to removable devices.

The plan is to wait a bit and see the different status in distributions about this issue.

Attachments

sugar-1357.patch Download (0.9 KB) - added by alsroot 4 years ago.

Change History

Changed 4 years ago by alsroot

  • keywords r? added

Changed 4 years ago by alsroot

Changed 4 years ago by alsroot

  • status changed from new to closed
  • resolution set to fixed

Changed 4 years ago by erikos

  • status changed from closed to reopened
  • resolution fixed deleted

I still see it on F11 and Ubuntu 9.04. I remember last time that reading there was uncertainity if we did allwe could do already in Sugar or not (if we have the exact same behavior then nautilus).

Changed 4 years ago by alsroot

  • keywords r? removed

Changed 4 years ago by tomeu

Just checked the Nautilus source and wrote in python the func that decides which drives, volumes and mounts should be displayed in the sidebar:

import gio

monitor = gio.volume_monitor_get()
for drive in monitor.get_connected_drives():
    if drive.get_volumes():
        for volume in drive.get_volumes():
            mount = volume.get_mount()
            if mount is not None:
                print 'Mount: %r %r %r' % (mount.get_icon(), mount.get_root(), mount.get_name())
            else:
                print 'Volume: %r %r' % (volume.get_icon(), volume.get_name())
    elif drive.is_media_removable() and not drive.is_media_check_automatic():
        print 'Drive: %r %r' % (drive.get_icon(), drive.get_name())

for volume in monitor.get_volumes():
    if volume.get_drive() is not None:
        continue
    mount = volume.get_mount()
    if mount is not None:
        print 'Mount: %r %r %r' % (mount.get_icon(), mount.get_root(), mount.get_name())
    else:
        print 'Volume: %r %r' % (volume.get_icon(), volume.get_name())

for mount in monitor.get_mounts():
    if mount.is_shadowed() or mount.get_volume() is not None:
        continue
    print 'Mount: %r %r %r' % (mount.get_icon(), mount.get_root(), mount.get_name())

What is printed is what we should be displaying, except probably the drive.

Changed 4 years ago by erikos

F12 (pygobject 2.20): all the volumes (partitions, removable devices) have the flag 'should_automount' set to 'false' on startup. This means that no devices are automounted on startup.

if hasattr(volume, 'should_automount') and not volume.should_automount():
        return

Changed 4 years ago by erikos

F11 with pygobject2-2.16: we do not have the 'should_automount' attribute, and try to automount all the devices (removable devices (usb) and partitions). We can not pass flag None to the mount command (which would not cause it to automount), since the bindings accept that only in 2.18. We could check if it is a removable disk in the automount_startup method to only mount removable devices (the same behavior as in nautilus).

Note: See TracTickets for help on using tickets.