Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a mobile device attached via USB to a Linux box and wish to unmount it. I ran the command fdisk -l however it does not list a mount point. I then ran the command lsusb which yielded the screenshot below.

enter image description here

I then proceeded to search the /dev/disk/by-id directory and was found the following file

enter image description here

The file is a symbolic link to what appears to be /dev/sdc

enter image description here

Questions

  1. Why does it not appear when I run the command fdisk -l?
  2. How do I unmount it properly without simply yanking the USB cord from the USB port?
share|improve this question
    
fdisk shows you partitions, not whether those partitions are mounted. Use mount to see what's mounted. And if the phone is just plugged in for charging, it might not be mounted at all. –  Wyzard Jul 8 '12 at 18:09
    
@Wyzard - Thanks. I did run the command mount and there no associated mount points either. If the device is simply charging why does it appear to be symbolically linked to /dev/sdc? –  PeanutsMonkey Jul 8 '12 at 19:12

3 Answers 3

up vote 1 down vote accepted

It's not your cards data partition shown there (that would be /dev/sdc1), but just the card. Since you decided to connect your device for charging only, Android kept the card mounted (and locked) on the device itself. Hence the computer can see the device (card, /dev/sdc), but cannot access the partition (/dev/sdc1). For the same reason, fdisk -l cannot see the partition, and thus doesn't list it.

To your second question: As you didn't mount it, you do not need to unmount either.

share|improve this answer
    
How do I then "detach" the device hence stopping any power from flowing to it? –  PeanutsMonkey Jul 10 '12 at 2:25
    
As you do now, and as you would do if connected to a "normal" power supply: simply plug the cable. There's nothing else to do in this case. –  Izzy Jul 10 '12 at 8:11
    
Why is that Windows offers the ability to safely remove the device when the device is not mounted akin to Linux? –  PeanutsMonkey Jul 11 '12 at 22:29
    
No idea. Windows always "knows better", even if its wrong... As stated above: Nothing was mounted, so nothing needs to be unmounted. As nothing was mounted, there are no caches to flush (which is what "safely remove" means: make sure all caches are written to the medium before disconnecting). So what? Maybe just to have the "user feel safe"? –  Izzy Jul 12 '12 at 6:56

Many USB devices appear as disk devices. When they are connected, the system sets up the plumbing to allow the device to be mounted. Depending on the configuration of auto-mount tools the device may or may not be mounted. In your case the device has been configured as a disk /dev/sdc, but appears not to have been mounted. When you unplug it this mapping will be removed.

You can safely unplug the device and the system will cleanup the entries associated with the device.

Even if the device were mounted, it is usually safe to simply unplug it. The auto-mount software will simply unmount the device and the rest of the cleanup will occur automatically. It is unsafe to the device to unmount it if their are pending changes to the disk partition(s). These are generally done within a few seconds of the change. If auto-flush is enabled, the time is less, but the wear on flash devices is higher.

EDIT: fdisk -l doesn't see the device because the system is not aware of any partitions on the device. It is possible that the device is formatted but not partitioned, or that it is neither partitioned nor formatted. If any partitions had been recognized you would have a device like /dev/sdc1 where the number is the partition number.

As you provided enough information to determine that you had a phone, I could safely assume that it was not a hard disk drive. Hard disks can have problems if power is suddenly removed, especially if they are in the middle of some action. The manufacturer should provide documentation on how to safely power down the drive. This may include actions like those specified in the post. Normally, parking the heads should be sufficient, but there may be fragile devices which require additional steps. If the disk has spun down, then it is likely ready to be unplugged.

The post comments about ensuring that I/O is complete are relevant, but as you had not mounted the device, that was also irrelevant in this case. The comments about allowing some time after I/O before unplugging the device allows for the I/O to complete.

For a device which is only plugged in to charge, unplugging it should have no more impact than unplugging it from its wall wart. The battery will take over as the power source. I have several devices that I charge this way. The one issue is whether the USB port provides enough power to charge the device while it is being used. Some of my devices won't run while connected to power which solves that problem.

share|improve this answer
    
Okay I get the device is not mounted, why does it not appear when I run the command fdisk -l? Secondly, if it has configured as /dev/sdc, it surely must be able to be powered down without simply unplugging the cable. For example I generally run the command udisks --detach /dev/sdc which powers down the device which can then be removed safely. Now based on the article at elliotli.blogspot.com/2009/01/…, it is recommended that you don't simply unplug the device. –  PeanutsMonkey Jul 8 '12 at 23:21

Apparently you have connected your device to charge only and have not enabled 'USB Storage' mode on the phone. That means, no partitions were mounted, so there is nothing to unmount.

In the case when you enabled USB storage mode then most likely your system will mount the sdcard and you will be able to browse it with a file manager on your box. In that case you can unmount the sdcard by clicking the triangle icon next to the device name in file manager (e.g. pcmanfm, nautilus, etc). Or you could do that from a console using something like sudo eject /dev/sdb. Type mount on its own to see the correct device name.

share|improve this answer
    
Why does it then symbolically reference /dev/sdc? –  PeanutsMonkey Jul 8 '12 at 23:21
    
And since when does "USB debugging" enable "USB storage"? Enabling USB debugging does not start the storage, but the adbd (Android Debug Bridge Daemon) on the device, to enable developers connecting it from their machines SDK. –  Izzy Jul 9 '12 at 13:39
    
@PeanutsMonkey: /dev/sdc is just a device, not a partition like /dev/sdc1 –  ccpizza Jul 10 '12 at 10:16
    
@Izzy: you are right, usb storage and usb debugging are two different things, i just remember i had to enable usb debugging to get usb storage to work, but that might be just a coincidence. –  ccpizza Jul 10 '12 at 10:23
    
@ccpizza yeah, I remember a problem with some Android version concerning this (maybe it even was device-specific), where turning-on USB debugging triggered something as a side-effect... Never mind, we cleared this up ;) –  Izzy Jul 10 '12 at 10:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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