Moved this because it seems to be an issue specifically with
rescan_scsi_bus.sh... it may be that there IS a kernel component too,
but for now I was able to obliterate a system using "rescan-scsi-bus.sh
-r" on a system wiht a pretty simple local FS setup:

ubuntu@barbos:~$ mount                                                          
                                                            
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime)                      
                                                            
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)                       
                                                            
udev on /dev type devtmpfs 
(rw,nosuid,relatime,size=32718576k,nr_inodes=8179644,mode=755,inode64)          
                                 
devpts on /dev/pts type devpts 
(rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs 
(rw,nosuid,nodev,noexec,relatime,size=6555388k,mode=755,inode64)
/dev/sda2 on / type ext4 (rw,relatime,stripe=128)                               
                                                            
securityfs on /sys/kernel/security type securityfs 
(rw,nosuid,nodev,noexec,relatime)                                               
         
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,inode64)                          
                                                            
tmpfs on /run/lock type tmpfs 
(rw,nosuid,nodev,noexec,relatime,size=5120k,inode64)
cgroup2 on /sys/fs/cgroup type cgroup2 
(rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot)
pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime) 
efivarfs on /sys/firmware/efi/efivars type efivarfs 
(rw,nosuid,nodev,noexec,relatime)                                               
        
bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700)     
systemd-1 on /proc/sys/fs/binfmt_misc type autofs 
(rw,relatime,fd=29,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=131329)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)  
mqueue on /dev/mqueue type mqueue (rw,nosuid,nodev,noexec,relatime)   
debugfs on /sys/kernel/debug type debugfs (rw,nosuid,nodev,noexec,relatime)
tracefs on /sys/kernel/tracing type tracefs (rw,nosuid,nodev,noexec,relatime)   
   
fusectl on /sys/fs/fuse/connections type fusectl 
(rw,nosuid,nodev,noexec,relatime)
configfs on /sys/kernel/config type configfs (rw,nosuid,nodev,noexec,relatime)  
                                                            
none on /run/credentials/systemd-sysusers.service type ramfs 
(ro,nosuid,nodev,noexec,relatime,mode=700)
tmpfs on /run/qemu type tmpfs (rw,nosuid,nodev,relatime,mode=755,inode64)
/var/lib/snapd/snaps/lxd_24322.snap on /snap/lxd/24322 type squashfs 
(ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/snapd_18357.snap on /snap/snapd/18357 type squashfs 
(ro,nodev,relatime,errors=continue,x-gdu.hide)                     
/dev/sda1 on /boot/efi type vfat 
(rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
/dev/sdb1 on /data-sdb type ext4 (rw,relatime,stripe=64)                        
                                                            
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc 
(rw,nosuid,nodev,noexec,relatime)
tmpfs on /run/snapd/ns type tmpfs 
(rw,nosuid,nodev,noexec,relatime,size=6555388k,mode=755,inode64)
nsfs on /run/snapd/ns/lxd.mnt type nsfs (rw)                          
/var/lib/snapd/snaps/core20_1828.snap on /snap/core20/1828 type squashfs 
(ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/snapd_18596.snap on /snap/snapd/18596 type squashfs 
(ro,nodev,relatime,errors=continue,x-gdu.hide)
/var/lib/snapd/snaps/core20_1852.snap on /snap/core20/1852 type squashfs 
(ro,nodev,relatime,errors=continue,x-gdu.hide)                     
tmpfs on /run/user/1000 type tmpfs 
(rw,nosuid,nodev,relatime,size=6555384k,nr_inodes=1638846,mode=700,uid=1000,gid=1000,inode64)
            
ubuntu@barbos:~$ sudo apt install sg3-utils                                     
                                                            
Reading package lists... Done                                                   
                                                            
Building dependency tree... Done                                                
                                                            
Reading state information... Done                                               
                                                            
sg3-utils is already the newest version (1.46-1build1).                         
                                                            
sg3-utils set to manually installed.                                            
                                                            
kiujln ,0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.          
   
ubuntu@barbos:~$ sudo rescan-scsi-bus.sh -r                            
Syncing file systems
Scanning SCSI subsystem for new devices and remove devices that have disappeared
Scanning host 0 for  SCSI target IDs 0
1
2
3
4
5
6
7, all LUNs
sg0 changed: LU not available (PQual 3)    
REM: Host: scsi0 Channel: 00 Id: 00 Lun: 00
DEL:  Vendor: HPE      Model: Smart Adapter    Rev: 3.53
      Type:   Enclosure                        ANSI SCSI revision: 05
sg3 changed: LU not available (PQual 3)    
REM: Host: scsi0 Channel: 02 Id: 00 Lun: 00
DEL:  Vendor: HPE      Model: P408i-a SR Gen10 Rev: 3.53
      Type:   RAID                             ANSI SCSI revision: 05
sg1 changed: LU not available (PQual 3)    
REM: Host: scsi0 Channel: 01 Id: 00 Lun: 00
      Vendor: HPE      Model: LOGICAL VOLUME   Rev: 3.53
DEL:  Type:   Direct-Access                    ANSI SCSI revision: 05

 Scanning for device 0 1 0 1 ...  535: /usr/bin/sleep: Input/output error
OLD: /usr/bin/rescan-scsi-bus.sh: line 153: cat: command not found
/usr/bin/rescan-scsi-bus.sh: line 154: cat: command not found
/usr/bin/rescan-scsi-bus.sh: line 155: cat: command not found
/usr/bin/rescan-scsi-bus.sh: line 161: cat: command not found
/usr/bin/rescan-scsi-bus.sh: line 162: cat: command not found
OLD: /usr/bin/rescan-scsi-bus.sh: line 153: cat: command not found
/usr/bin/rescan-scsi-bus.sh: line 154: cat: command not foundd
/usr/bin/rescan-scsi-bus.sh: line 155: cat: command not found
/usr/bin/rescan-scsi-bus.sh: line 161: cat: command not found
/usr/bin/rescan-scsi-bus.sh: line 162: cat: command not found
/usr/bin/rescan-scsi-bus.sh: line 357: head: command not found
/usr/bin/rescan-scsi-bus.sh: line 358: tail: command not found
/usr/bin/rescan-scsi-bus.sh: line 358: pr: command not found
0 new or changed device(s) found.           
0 remapped or resized device(s) found.
3 device(s) removed.                  
\t[0:0:0:0]\n\t[0:2:0:0]\n\t[0:1:0:0]\nubuntu@barbos:~$ 
ubuntu@barbos:~$ mount
-bash: /usr/bin/mount: Input/output error
ubuntu@barbos:~$ sudo rescan-scsi-bus.sh                               
-bash: /usr/bin/sudo: Input/output error


Pretty sure this shouldn't remove mounted, active file systems, though to be 
fair I've not used this script in a very long time.
                                                  

** Package changed: linux (Ubuntu) => sg3-utils (Ubuntu)

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1976228

Title:
  [Ubuntu 22.04 LTS]The host OS becomes read-only after the 'rescan-
  scsi-bus.sh -r' command is executed

Status in sg3-utils package in Ubuntu:
  Confirmed

Bug description:
  OS:Ubuntu 22.04 LTS
  kernel:5.15.0-33-generic
  host model:Dell PowerEdge R630
  issue description:
  After I mapped luns from array to my host, I ran 'rescan-scsi-bus.sh -r' to 
scan for luns, my host crashed and became read-only.After the KVM forcibly 
restarts the host, the host is restored to normal.
  --- 
  ProblemType: Bug
  AlsaDevices:
   total 0
   crw-rw---- 1 root audio 116,  1 May 30 08:33 seq
   crw-rw---- 1 root audio 116, 33 May 30 08:33 timer
  AplayDevices: Error: [Errno 2] No such file or directory: 'aplay'
  ApportVersion: 2.20.11-0ubuntu82.1
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory: 'arecord'
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/seq', 
'/dev/snd/timer'] failed with exit code 1:
  CRDA: N/A
  DistroRelease: Ubuntu 22.04
  InstallationDate: Installed on 2022-05-26 (4 days ago)
  InstallationMedia: Ubuntu-Server 22.04 LTS "Jammy Jellyfish" - Release amd64 
(20220421)
  IwConfig: Error: [Errno 2] No such file or directory: 'iwconfig'
  Package: linux (not installed)
  PciMultimedia:
   
  ProcEnviron:
   TERM=xterm
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcFB: 0 mgag200drmfb
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-5.15.0-33-generic 
root=/dev/mapper/ubuntu--vg-ubuntu--lv ro
  ProcVersionSignature: Ubuntu 5.15.0-33.34-generic 5.15.30
  RelatedPackageVersions:
   linux-restricted-modules-5.15.0-33-generic N/A
   linux-backports-modules-5.15.0-33-generic  N/A
   linux-firmware                             20220329.git681281e4-0ubuntu3
  RfKill: Error: [Errno 2] No such file or directory: 'rfkill'
  Tags:  jammy uec-images
  Uname: Linux 5.15.0-33-generic x86_64
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: N/A
  _MarkForUpload: True
  dmi.bios.date: 05/14/2021
  dmi.bios.release: 2.13
  dmi.bios.version: 2.13.0
  dmi.board.name: 02C2CP
  dmi.board.version: A01
  dmi.chassis.type: 23
  dmi.modalias: 
dmi:bvn:bvr2.13.0:bd05/14/2021:br2.13:svn:pn:pvr:rvn:rn02C2CP:rvrA01:cvn:ct23:cvr:skuSKU=NotProvided;ModelName=:
  dmi.product.sku: SKU=NotProvided;ModelName=

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/sg3-utils/+bug/1976228/+subscriptions


-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to