0

I'm using Xubuntu 18.04 on a Dell XPS 15 7590. I've been having a really weird problem since I used this computer to create a bootable USB Stick so I could install Xubuntu 20.04 on a different computer. I used this command to create the bootable USB stick:

$ sudo dd bs=4M if=xubuntu-20.04-desktop-amd64.iso of=/dev/sda status=progress oflag=sync

Notice that I used /dev/sda, not /dev/sda1. (And no, I didn't overwrite my system disk; the system disk is /dev/nvme0n1.)

The install stick worked great, and I successfully installed Xubuntu 20.04 on the other computer. But now, when I insert any USB stick into my Xubuntu 18.04 Dell computer, it appears to be the install stick that I created! It auto-mounts as an ISO filesystem, and I can even read the files, even though they definitely aren't on the USB stick that I put in. It doesn't matter what size the USB stick is or what port I insert it into -- they all appear the same.

It seems like the stick's partition table and ISO filesystem is cached (maybe possible because this computer has 32GB RAM), and Linux is always re-using that same cache for every USB stick, regardless of the stick's serial number, label, or whatever else sticks use as identity.

Here is the lsblk of a different 4GB USB Stick (not the Xubuntu 20.04 install stick!):

$ sudo lsblk -O /dev/sda
NAME KNAME MAJ:MIN FSTYPE MOUNTPOINT LABEL UUID                                 PARTTYPE PARTLABEL PARTUUID PARTFLAGS  RA RO RM HOTPLUG MODEL SERIAL  SIZE STATE OWNER GROUP MODE       ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN RAND PKNAME HCTL       TRAN SUBSYSTEMS  REV VENDOR ZONED
sda  sda     8:0                                                                                                      128  0  1       1 HS US         3.7G runni root  disk  brw-rw----         0   1024      0    1024    1024    1 mq-deadline
│                                                                                                                                                                                                                                                2 disk        0        0B       0B         0    0B        1        3:0:0:0    usb  block:scsi:usb:pci
│                                                                                                                                                                                                                                                                                                                                              2.00 ACTION none
└─sda1
     sda1    8:1   iso966            Xubuntu 20.04 LTS amd64
                                           2020-04-23-07-50-17-00                                                     128  0  1       1               3.7G       root  root  -rw-r--r--         0   1024      0    1024    1024    1 mq-deadline
                                                                                                                                                                                                                                                 2 part        0        0B       0B         0    0B        1 sda                    block:scsi:usb:pci
                                                                                                                                                                                                                                                                                                                                                           none

Here's a different 32GB stick:

$ sudo lsblk -O /dev/sda
NAME KNAME MAJ:MIN FSTYPE MOUNTPOINT LABEL UUID                                 PARTTYPE PARTLABEL PARTUUID PARTFLAGS  RA RO RM HOTPLUG MODEL SERIAL  SIZE STATE OWNER GROUP MODE       ALIGNMENT MIN-IO OPT-IO PHY-SEC LOG-SEC ROTA SCHED RQ-SIZE TYPE DISC-ALN DISC-GRAN DISC-MAX DISC-ZERO WSAME WWN RAND PKNAME HCTL       TRAN SUBSYSTEMS  REV VENDOR ZONED
sda  sda     8:0                                                                                                      128  0  1       1 Patri 07014B 28.9G runni root  disk  brw-rw----         0    512      0     512     512    1 mq-deadline
│                                                                                                                                                                                                                                                2 disk        0        0B       0B         0    0B        1        3:0:0:0    usb  block:scsi:usb:pci
│                                                                                                                                                                                                                                                                                                                                              PMAP        none
└─sda1
     sda1    8:1   iso966            Xubuntu 20.04 LTS amd64
                                           2020-04-23-07-50-17-00                                                     128  0  1       1              28.9G       root  root  -rw-r--r--         0    512      0     512     512    1 mq-deadline
                                                                                                                                                                                                                                                 2 part        0        0B       0B         0    0B        1 sda                    block:scsi:usb:pci
                                                                                                                                                                                                                                                                                                                                                           none

As you can see, they both appear to have the "Xubuntu 20.04" label, even though they really don't.

Do you guys have any ideas? Thanks.

Different problem, but probably related: https://support.google.com/chromebook/thread/7883827?hl=en

8
  • /dev/sda is typically the local (internal) disk. Are you sure you've not overwritten your system?
    – roaima
    Apr 27, 2020 at 18:36
  • 1
    Yes, I'm sure. On my computer, the system disk is /dev/nvme0n1.
    – likebike
    Apr 27, 2020 at 18:39
  • Does mount | grep sda return anything?
    – roaima
    Apr 27, 2020 at 18:44
  • When I first insert a USB stick, the system auto-mounts the cached ISO filesystem: /dev/sda1 on /media/likebike/Xubuntu 20.04 LTS amd64 type iso9660 (ro,nosuid,nodev,relatime,nojoliet,check=s,map=n,blocksize=2048,uid=1000,gid=1000,dmode=500,fmode=400,uhelper=udisks2) ...But then I manually un-mount it.
    – likebike
    Apr 27, 2020 at 18:46
  • That's very strange. Certainly not what I'd expect
    – roaima
    Apr 27, 2020 at 18:49

1 Answer 1

2

Is it possible that you've actually dd'ed into /dev/sda when the device /dev/sda wasn't recognised by the system for some reason, like you'd forgot to put it in, or the connection went funny for a minute, or something like that, so /dev/sda is now an actual file stored in /dev, instead of a special device file populated by the system?

Does ls -lga /dev/sd* still show sda even when the USB drives have been removed? Or is it gone like you'd expect until one's plugged in. Also do multiple extra /dev/sd* devices pop up when you plug one in? Could it be that it's assigning new drives to sdb, sdc etc as expected, but still mounting that /dev/sda image file only when another hardware drive is detected? A way to tell between regular and device files is whether the owner shows "disk" or "root"

!! - pretty much the entire next paragraph has potential for data loss, so be double-sure there's nothing on the USB that you want, double-check root, take backups etc!!

If the /dev/sda seems to exist as a file on its own regardless of whether there's a USB in, and you're certain it's not root or another file system with important stuff on, just try rm /dev/sdaing it. If it only exists when there's a USB in, and there is no other sdb/sdc/sd[etc] being made when one's inserted, something may have gone wrong on the device's partition table. You can create a new one using fdisk(mbr)/gdisk(gpt)/gparted(graphical/both) but that will cause data loss.

A last path of investigation, how does ls /dev/disk/by-id/ change when you add/remove usb drives in the current state?

1
  • 2
    WOW! You are a GENIUS! You were right -- there was a /dev/sda1 regular file. I deleted it, and now everything works as expected. I'm really amazed you were able to figure that out.
    – likebike
    Apr 27, 2020 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.