Public bug reported:

umounting the root partition should give errors, but 9.04 returns no error, 
although umounting is unsuccessful.
and other strange things happens after that.
I found the bug because this script is an endless loop in 9.04 when $part 
happens to be the root partition:

      while mount | grep "^$part " > /dev/null; do
      umount $part || { echo "Failed to umount $part"; exit 1; }
      done

Details:

billb...@billbear-laptop:~$ sudo -i
[sudo] password for billbear: 
r...@billbear-laptop:~# 
r...@billbear-laptop:~# mount
/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
lrm on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=755)
/dev/sda1 on /boot type ext4 (rw,relatime)
/dev/sda6 on /home type ext4 (rw,relatime)
/dev/sda7 on /tmp type ext4 (rw,relatime)
/dev/sda8 on /usr type ext4 (rw,relatime)
/dev/sda9 on /var type ext4 (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc 
(rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/billbear/.gvfs type fuse.gvfs-fuse-daemon 
(rw,nosuid,nodev,user=billbear)
r...@billbear-laptop:~# 
r...@billbear-laptop:~# mount /dev/sda5 /mnt       # mounting the root 
partition elsewhere is possible
r...@billbear-laptop:~# ls /mnt
bin  boot  cdrom  dev  etc  home  initrd.img  lib  lost+found  media  mnt  opt  
proc  root  sbin  selinux  srv  sys  tmp  usr  var  vmlinuz
r...@billbear-laptop:~# mount | grep sda5          # successfully mounted
/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
/dev/sda5 on /mnt type ext4 (rw)
r...@billbear-laptop:~# 
r...@billbear-laptop:~# umount /dev/sda5           # umount only the last mount 
ponit of root on /mnt
r...@billbear-laptop:~# mount | grep sda5          # successfully umounted
/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
r...@billbear-laptop:~# 
r...@billbear-laptop:~# 
r...@billbear-laptop:~# umount /dev/sda6           # refuse to umount /home.
umount: /home: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))

r...@billbear-laptop:~#
##################################################### The above are
expected behaviors, below comes the bug #################


r...@billbear-laptop:~# umount /dev/sda5           # but umounting the root 
partition gives no error
r...@billbear-laptop:~# echo $?
0
r...@billbear-laptop:~# mount | grep sda5          # although it cannot really 
be umounted. (it is still there)
/dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)

r...@billbear-laptop:~# ######## after the "successful umount" of root,
things go strange:

r...@billbear-laptop:~# mount /dev/sda5 /mnt       # this time the root 
partition can no longer be mounted elsewhere
mount: /dev/sda5 already mounted or /mnt busy
mount: according to mtab, /dev/sda5 is mounted on /
r...@billbear-laptop:~# mount /dev/sda6 /mnt       # home partition can still 
be mounted elsewhere, it seems ok but
r...@billbear-laptop:~# ls /mnt
billbear  lost+found
r...@billbear-laptop:~# mount | grep sda6          # the home partition mounted 
on /mnt does not appear in the mount list
/dev/sda6 on /home type ext4 (rw,relatime)
r...@billbear-laptop:~# ls /mnt                    # although it is obviously 
there
billbear  lost+found
r...@billbear-laptop:~# umount /dev/sda6           # this command can no longer 
umount home partition on /mnt
umount: /home: device is busy.
        (In some cases useful info about processes that use
         the device is found by lsof(8) or fuser(1))
r...@billbear-laptop:~# umount /mnt                # this command can still 
umount home partition on /mnt
r...@billbear-laptop:~# ls /mnt                    # successfully umounted
r...@billbear-laptop:~# mkdir /mnt/1               # now the file system 
becomes read-only.
mkdir: cannot create directory `/mnt/1': Read-only file system
r...@billbear-laptop:~# mkdir /1
mkdir: cannot create directory `/1': Read-only file system

** Affects: ubuntu
     Importance: Undecided
         Status: New

** Description changed:

  umounting the root partition should give errors, but 9.04 returns no error, 
although umounting is unsuccessful.
  and other strange things happens after that.
  I found the bug because this script is an endless loop in 9.04 when $part 
happens to be the root partition:
  
        while mount | grep "^$part " > /dev/null; do
        umount $part || { echo "Failed to umount $part"; exit 1; }
        done
  
  Details:
  
  billb...@billbear-laptop:~$ sudo -i
  [sudo] password for billbear: 
  r...@billbear-laptop:~# 
  r...@billbear-laptop:~# mount
  /dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
  tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
  proc on /proc type proc (rw,noexec,nosuid,nodev)
  sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
  varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
  varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
  udev on /dev type tmpfs (rw,mode=0755)
  tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
  devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
  fusectl on /sys/fs/fuse/connections type fusectl (rw)
  lrm on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=755)
  /dev/sda1 on /boot type ext4 (rw,relatime)
  /dev/sda6 on /home type ext4 (rw,relatime)
  /dev/sda7 on /tmp type ext4 (rw,relatime)
  /dev/sda8 on /usr type ext4 (rw,relatime)
  /dev/sda9 on /var type ext4 (rw,relatime)
  securityfs on /sys/kernel/security type securityfs (rw)
  binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc 
(rw,noexec,nosuid,nodev)
  gvfs-fuse-daemon on /home/billbear/.gvfs type fuse.gvfs-fuse-daemon 
(rw,nosuid,nodev,user=billbear)
  r...@billbear-laptop:~# 
- r...@billbear-laptop:~# mount /dev/sda5 /mnt       # mount the root partition 
elsewhere is possible
+ r...@billbear-laptop:~# mount /dev/sda5 /mnt       # mounting the root 
partition elsewhere is possible
  r...@billbear-laptop:~# ls /mnt
  bin  boot  cdrom  dev  etc  home  initrd.img  lib  lost+found  media  mnt  
opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var  vmlinuz
- r...@billbear-laptop:~# mount | grep sda5          # successful mounted
+ r...@billbear-laptop:~# mount | grep sda5          # successfully mounted
  /dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
  /dev/sda5 on /mnt type ext4 (rw)
  r...@billbear-laptop:~# 
  r...@billbear-laptop:~# umount /dev/sda5           # umount only the last 
mount ponit of root on /mnt
- r...@billbear-laptop:~# mount | grep sda5          # successful umounted
+ r...@billbear-laptop:~# mount | grep sda5          # successfully umounted
  /dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
  r...@billbear-laptop:~# 
  r...@billbear-laptop:~# 
  r...@billbear-laptop:~# umount /dev/sda6           # refuse to umount /home.
  umount: /home: device is busy.
          (In some cases useful info about processes that use
           the device is found by lsof(8) or fuser(1))
  
  r...@billbear-laptop:~#
  ##################################################### The above are
  expected behaviors, below comes the bug #################
  
  
  r...@billbear-laptop:~# umount /dev/sda5           # but umounting the root 
partition gives no error
  r...@billbear-laptop:~# echo $?
  0
  r...@billbear-laptop:~# mount | grep sda5          # although it cannot 
really be umounted. (it is still there)
  /dev/sda5 on / type ext4 (rw,relatime,errors=remount-ro)
  
  r...@billbear-laptop:~# ######## after the "successful umount" of root,
  things go strange:
  
  r...@billbear-laptop:~# mount /dev/sda5 /mnt       # this time the root 
partition can no longer be mounted elsewhere
  mount: /dev/sda5 already mounted or /mnt busy
  mount: according to mtab, /dev/sda5 is mounted on /
  r...@billbear-laptop:~# mount /dev/sda6 /mnt       # home partition can still 
be mounted elsewhere, it seems ok but
  r...@billbear-laptop:~# ls /mnt
  billbear  lost+found
  r...@billbear-laptop:~# mount | grep sda6          # the home partition 
mounted on /mnt does not appear in the mount list
  /dev/sda6 on /home type ext4 (rw,relatime)
  r...@billbear-laptop:~# ls /mnt                    # although it is obviously 
there
  billbear  lost+found
  r...@billbear-laptop:~# umount /dev/sda6           # this command can no 
longer umount home partition on /mnt
  umount: /home: device is busy.
          (In some cases useful info about processes that use
           the device is found by lsof(8) or fuser(1))
  r...@billbear-laptop:~# umount /mnt                # this command can still 
umount home partition on /mnt
  r...@billbear-laptop:~# ls /mnt                    # successfully umounted
- r...@billbear-laptop:~# mkdir /mnt/1               # now the file system 
become read-only.
+ r...@billbear-laptop:~# mkdir /mnt/1               # now the file system 
becomes read-only.
  mkdir: cannot create directory `/mnt/1': Read-only file system
  r...@billbear-laptop:~# mkdir /1
  mkdir: cannot create directory `/1': Read-only file system

-- 
[jaunty] bug when umounting the root partition
https://bugs.launchpad.net/bugs/373782
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to