Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
63 votes

Eject USB drives / eject command

On Linux, eject will work, but will not really "finish the job" regarding USB rotating drives. So first, you eject /dev/sdb (or umount everything). And then, after proper unmounting, the ...
user avatar
  • 17.6k
44 votes
Accepted

How to create a bootable Debian USB drive using Windows

To create a bootable USB, you can follow the steps below: STEP 1 Go to the website of the OS you wish to install, and find an iso image to download. In your case, since you want to run a Debian OS, ...
user avatar
40 votes
Accepted

Why can't I copy all files in a directory to a USB storage device?

My eyes jump straight to the fact that your file name has a pipe | in it. According to your output the file system type is exfat. FAT and its derivatives do not support inclusion of pipe, along with a ...
user avatar
  • 3,292
38 votes
Accepted

How to make an ext4 formatted usb drive with full RW permissions for any linux machine?

Like any unix-style filesystem, ext4 includes standard Unix file ownership and permission conventions. That is, the user is identified by an UID number, and each user will belong to one or more groups,...
user avatar
  • 67.1k
28 votes

How do I boot from a liveusb using qemu-kvm?

qemu-kvm has disappeared. use the hint in start qemu by giving it a path to a linux root instead. this means qemu-system-x86_64 -usb -usbdevice disk:/dev/sdb where /dev/sdb is your raw device (not ...
user avatar
  • 591
25 votes

Eject USB drives / eject command

Manual steps for unmounting disk /dev/sdb (Requires sudo): echo 'offline' > /sys/block/sdb/device/state echo '1' > /sys/block/sdb/device/delete This will completely power-off the device and ...
user avatar
22 votes

mount is not executed when called by udev

systemd-udevd runs in its own file system namespace and by default mounts done within udev .rules do not propagate to the host. To make your old scripts work you can set MountFlags=shared in /usr/lib/...
user avatar
  • 221
22 votes

Why does Linux use SCSI drivers for non-SCSI devices?

SCSI is not only a type of hardware interface, but also a command protocol, which is used for abstraction of most of the modern storage devices. Linux scsi driver is a high level driver that handles a ...
user avatar
  • 11.8k
17 votes
Accepted

Timestamps of files copied to USB drive

The problem with the timestamp seconds changing comes from the fact that a VFAT (yes, even FAT32) filesystem stores the modification time with only 2-second resolution. Apparently, as long as the ...
user avatar
  • 67.1k
15 votes
Accepted

Re-reading the partition table failed with error 16: Device or resource busy

Looks like this device is mounted. Run umount /dev/sdb1 and try again.
user avatar
  • 2,082
11 votes

How to reconnect a logically disconnected USB device?

udevadm info -a -n /dev/sdb Now check for Kernel. E.g. if it is connected to Port 2 of Front UIP then it would be 1-1.2 and if it is connected to Port 1 of Front UIP then it would be 1-1.1. For Port ...
user avatar
  • 161
11 votes

How to differentiate USB flash drive and CD-ROM?

If a USB flash device and USB cdrom is connected then only difference that I can find out is their kernel driver. Both uses the common usb and usb-storage kernel module but in addition to that CD-ROM ...
user avatar
  • 13.5k
11 votes
Accepted

Copying to USB drive modifies filename

I suspect you are using a mount command like the one below: mount -t msdos /dev/XYZ /mnt/test This will force the partition to be mounted in legacy DOS FAT filesystem which uses the 8.3 ...
user avatar
  • 148
11 votes

How to disable creation of .Trash-1000 folder?

I have found an interesting workaround that works on a per device basis, tested on Xubuntu 18.10 with USB devices and EncFS mounts. It's very simple, remove the desired .Trash-$(id -u) directory (id -...
user avatar
  • 4,442
11 votes
Accepted

Wait to start Transmission daemon until after USB drive has mounted?

EDIT: It turns out my first approach didn't work as expected. An [Install] section on an overrides file doesn't really work and RequiresMountsFor= seems to only work for mounts which are declared in ...
user avatar
  • 19.4k
10 votes

How to format 720k FAT (ie: MS-DOS) floppy on Linux using USB floppy drive

I have just successfully formatted a completely blank floppy in a USB drive. This required a proper format, and not just writing a filesystem to the disk, because there were no sectors on it yet. ...
user avatar
  • 5,836
9 votes
Accepted

How can I create a udev rule to mount a USB drive read only?

Ok, the summary is that Nautilus uses GVFS and you need to tell udev to use GVFS too when reading the fstab entries, you can do this using: /dev/block-device /mount/point auto x-gvfs-show,ro 0 0 x-...
user avatar
  • 33.9k
9 votes

Access USB drive on Ubuntu server

After attaching your USB drive to a server, run in terminal lsblk, you will see all storage devices, that are attached to your machine. You may find there your USB drive (usually, they are named /dev/...
user avatar
9 votes
Accepted

Unable to copy large file onto ext2 usb stick

Your 8GB stick has approximately 7.5 GiB and even with some file system overhead should be able to store the 5.4GiB file. You use tune2fs to check the file sytem status and properties: tune2fs -l /...
user avatar
  • 32.1k
9 votes

Why does it take so long to detect an usb stick?

Turns out that there's a 1 second timeout int drivers/usb/storage/usb.c. I enabled more debug-logging by typing the following two commands: echo 8 > /proc/sys/kernel/printk echo "module ...
user avatar
8 votes

Mounting USB drive that is not recognized

I used ENV{MTP_NO_PROBE}="1" to stop the MTP Probe. That way I didn't have modify the Arch's /lib/udev/rules.d/69-libmtp.rules. export MTP_NO_PROBE="1"
user avatar
8 votes

Why can I not see some files in my USB stick on Windows that I can see on Linux?

UPDATE So, I really didn't think I would be researching NTFS this morning, but, thanks mostly to @AndrewMedico's comments below, I learned something. The truth is file streams are weird, and they ...
user avatar
  • 55.6k
8 votes

Monitor history of USB flash drives

Well, there is no ready-for-that software I know. But you can write your own script, which will be started when pendrive is inserted|removed from usb port. This script would be run by udev if you add ...
user avatar
8 votes
Accepted

How to disable creation of .Trash-1000 folder?

Have a look at this article. According to the article, Ubuntu will create such folders when a file is deleted from a USB drive. Presumably this would allow a file to be restored if you accidentally ...
user avatar
  • 478
7 votes

How to re-mount a USB stick after unmounting from Nautilus without disconnecting it?

On Debian based systems, at least, you should be able to do this: figure out what the drive letter should be... I'm gong to say /dev/sdb here for the example. Double eject the 'would be' drive letter ...
user avatar
7 votes

Installing Kali on a USB drive - NOT Live USB or Persistence partition

Install Kali into a VirtualBox VM with the USB attached as the first hard drive. You can attach the USB to VirtualBox following this guide: Using a Physical Hard Drive with a VirtualBox VM I have ...
user avatar
7 votes

Copying to USB drive modifies filename

It is probably the file-system on the usb-storage. FAT file system can only support file-names of 8+3 characters. This file-system is very old. It is only needed for backwards compatibility with very ...
user avatar
7 votes

LUKS with USB key authentication, how secure is it?

It depends on your point of view. It's more secure since keyfiles usually are truly random while passphrases tend to be short and weak. Then again a passphrase, on its own, takes about $5 to break, ...
user avatar
  • 41.8k
7 votes

How to use proprietary wireless drivers during Debian USB install?

The easiest way imho, is to use one of the ”unofficial” images that contain non-free firmware. They can be found here: https://cdimage.debian.org/cdimage/unofficial/non-free/cd-including-firmware/ ...
user avatar
  • 8,060

Only top scored, non community-wiki answers of a minimum length are eligible