Tag Info

Hot answers tagged

22

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 variety of storage hardware. Protocol: http://en.wikipedia.org/wiki/SCSI_command Extract from SCSI on wikipedia: Other technologies which use the SCSI ...


21

Are you using a 64-bit version of Linux with a lot of memory? In that case the problem could be that Linux can lock for minutes on big writes on slow devices like for example SD cards or USB sticks. It's a known bug that should be fixed in newer kernels. See http://lwn.net/Articles/572911/ Workaround: as root issue: echo $((16*1024*1024)) > ...


15

Yes. For example: eject /dev/sda Other answers here that indicate that you require mechanical ejection hardware are incorrect. Unmounting is not the same thing as ejecting. If you unmount a volume, you can immediately mount it back, because the underlying device is still available. In some situations, this could present a security risk. By ejecting ...


15

Suppose your usb drive is mounted to /media/usb then it would be sufficient to do sudo umount /media/usb Suppose the your usb is /dev/sdb1 then you could also do sudo umount /dev/sdb1 You may also have a look at the anwers of one of my questions, how to umount all attached usb devices with a single command: Umount all attached usb disks with a single ...


13

It is sometimes possible to do a power cycle on branch of the USB bus where the device is plugged : # echo suspend > /sys/bus/usb/devices/1-1/power/level # echo auto > /sys/bus/usb/devices/1-1/power/level The 1-1 should be adjusted to your configuration. You can see to which part of the USB tree your device is plugged by running lsusb -t before ...


12

Following method works with CentOS 6.2: Requirements: USB flash drive (at least 4 GB, I used a 16 GB one) Download an ISO image from a mirror - I chose the full 1st DVD image to avoid a network install (because it is not clear if the cryptographic package signatures are checked by the installer or not), e.g.: $ wget ...


12

qemu-kvm -hdb <device>, where <device> is the USB stick (e.g. /dev/sdb), should do it (tested with Ubuntu 12.04 on an USB stick and it works). You will need write permission to the device (i.e. be root or change its permissions).


12

There is a vendor independent SAT (SCSI/ATA transfer) standard, but AFAIK this is not widely supported on (cheaper) bridges. There are several vendor specific ATA pass-through commands that you can select with smartctl with the -d option: -d TYPE, --device=TYPE Specify device type to one of: ata, scsi, sat[,N][+TYPE], usbcypress[,X], ...


11

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 uses sr module while USB uses the sd module. Based on this info, you can write UDEV rule


10

Yes, this can occur if your device is formatted with a filesystem that does not support that kind of permission setting, such as VFAT. In those cases, the umask is made up on the fly from a setting in the fstab (or the hotplugging equivalent). See, most probably, man mount for details. For example, for VFAT, we find: Mount options for fat ...


9

Have a look under the /sys/ directory. In particular, /sys/block/ contains symlinks to block devices in /sys/devices/. /sys/block/sdX/removable looks like it will read as 1 for a removable device, and 0 otherwise. This gives you a basic check for removability. I'm not sure if there's a better way to check if it's a USB device, but readlink /sys/block/sde ...


9

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 /dev/<device> By default 5% of the space is reserved for the root user. Your output lists 97894 blocks, which corresponds to approximately 385MiB and ...


7

This is Gilles' answer, saving it here so it doesn't get lost. If you use the sync mount option on the removable drive, all writes are written to the disk immediately, so you won't lose data from not-yet-written files. It's a bad idea, but it does what you're asking, kind of. Note that sync does not guarantee that you won't lose data. Unmounting a ...


7

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-gvfs-show will tell udev and anyone interested to use the GVFS helper to mount the filesystem, so gvfs has all the control mounting, umounting, moving mount ...


7

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 confuse me, but apparently it gets deeper. Behaving in a way very like NTFS file streams, Transactional NTFS commits file changes to some alternate cache until ...


6

If you want to create a filesystem on your usb stick partition, you should do mkfs -t vfat /dev/sdc1 as a user who as access rights to write to the partition, like root


6

No. Nor do they need to be; eject is used for opening optical drives, where one cannot pull the media from directly. Unmounting is sufficient for USB/eSATA/etc. storage devices.


6

eject will work, but will not really "finish the job" regarding USB rotating drives. The best way to unplug a USB external hard-drive, after proper unmounting, is: udisks --detach /dev/sdb This usually causes the drive to spin down gracefully. Precisely, the current implementation: sends SCSI sync-cache command, sends SCSI stop command, unbinds ...


6

I don't know why exactly, but Renan's answer didn't quite work for me. KVM said to me it couldn't find a bootable drive (despite the usb partition being marked as such). However I've found another solution. Get the USB device VendorID:ProductID with lsusb. Example: $ lsusb ... Bus 002 Device 007: ID 0781:5406 SanDisk Corp. Cruzer Micro U3 Pass that to ...


6

SMART over USB is generally either not possible, or is done with (bridge) vendor-specific commands, so there's no one way to get things done. smartctl knows about a few specific bridge chips. Check the manpage for a list. This is horrible, but the only 100% reliable way to access SMART on a disk is to unplug it from the bridge and stick it on a proper host ...


6

When you mount a partition, it will show in df -h, and if you umount it, then it will no longer show in df -h fdisk -l uses /proc/partitions and prints out all partitions which are physically connected, but your USB drive is still connected to your PC. When you unplug it, then it will not show in fdisk -l anymore, and you can also check cat ...


6

If you use the sync mount option on the removable drive, all writes are written to the disk immediately, so you won't lose data from not-yet-written files. It's a bad idea, but it does what you're asking, kind of. Note that sync does not guarantee that you won't lose data. Unmounting a removable drive also ensures that no application has a file open. If you ...


5

This is the behavior I have on my Ubuntu Lucid system: When I plug in my USB flash/thumbdrive which has two partitions, the system reports: $ ls /dev/sdb* /dev/sdb /dev/sdb1 /dev/sdb2 $ udisks --show-info /dev/sdb | grep -A2 'partition table\|by-id' by-id: /dev/disk/by-id/usb-takeMS_USB_Mini_AA07013000010057-0:0 by-path: ...


5

From my experience in Ubuntu, when you "eject" a USB stick from within Nautilus, the device actually disappears from the system. I'm not sure why this is, but neither Nautilus nor the command line can get it back. I guess the logic is that once you eject a USB stick you don't want it back, but are going to disconnect it. The way I work around this (when ...


5

Reset the device, or the hub it is connected to, and the device should reappear. Here is a small program to do that: http://marc.info/?l=linux-usb-users&m=116827193506484 It works for most USB drives I've tried, but there are exceptions, like my Kingston DT 101 II 4GB, which fails INQUIRY and READ CAPACITY commands after reset, and remains unusable ...


5

Was the name of the device U167CONTROLLER before? It may be that the microcontroller on the device has encountered some abnormal condition (totally possible with less than totally reputable manufacturers) and needs to be reprogrammed. This is a bit of a black art and it's likely you will only find Windows programs that can reprogram the microcontroller. ...


5

You can use graphical tools to achieve this, such as GParted. You can install this like so: apt-get update apt-get install gparted Your OS may also include a graphical package manager, if so, you can alternatively install the gparted package from there. After gparted is installed, run it. Select your flash drive (be careful, make sure it is the right ...


5

USB mass storage mode is only for accessing the microSD card. Linux is reporting that there is no medium because you don't have a card inserted in the phone. Mass storage mode provides exclusive access to the card, and it provides that access on a raw device level, below even the filesystem. You're using Linux's implementation of vfat, not the phone's. You ...


5

Patient: "Doctor, It hurts when I do this." Doctor: "Well, don't do that." — maybe the Marx Brothers, but they probably stole it from other vaudevillians if so Both answers are fine, but I do question the question. If you can't remember to unmount a thumbdrive properly before removing it, perhaps you should remember harder. In general, the ...


5

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 this to /etc/udev/rules/99-local.rules: ACTION=="add|remove", SUBSYSTEM=="block", KERNEL=="sd*", RUN+="/usr/local/bin/usb-add.sh" and then in this script you ...



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