Linux - KernelThis forum is for all discussion relating to the Linux kernel.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
1. I inserted usb A, and Linux detected it as sda.
2. I extract usb A.
3. I did "umount -l" after extract the usb.
Because "umount" did not work after the extration like below.
Quote:
# mount
...
/dev/sda1 on /mnt/usb type ext3 (rw,data=ordered)
# umount /mnt/usb
umount: Couldn't umount /mnt/usb: No such device or address
4. And I reinserted the same usb A.
But, Linux detect it as sdb. Even the system has only one usb.
I think something did not cleaned perfectly.
Because, Linux is writing on the usb when I extract it from the system.
Because, Linux is writing on the usb when I extract it from the system.
This is a really bad idea! Never unplug a device that is being used. You need to umnount it before removing it, not doing so will have strange possible side effects:
- data might become corrupted,
- the system still thinks the device is still present (which explains it showing up as sdb).
Again: _Never_ unplug a device that is still mounted. Unmount it and then remove it.
Thank you druuna.
Is there any way to make the linux thinks the usb removed?
Bit of an ambiguous question...
- Are you talking about removing the entry after wrongfully removing the device (sda in your case)? If so:
There's no real need to do this manually. The system will pick up on it eventually and do some housecleaning itself.
- Or are you asking how to unmount a device? If that is the case:
If you use a GUI the right click on the device an umount option should be present, if you use the terminal then use the following command:
Code:
df -h # <- to figure out the device name
umount /dev/sdXY
The X can be a, b, c etc and the Y is a number, which is shown by the df -h command.
Thank you Druuna.
I was talking about removing the entry after wrongfully removing the device.
Because my system detect the same usb as sdb after abnormal removing.
I thought the reason is that the linux thinks the usb still present.
But judging by the account of you,
If I want to detect it as sda again, the only thing I can do is just waiting for cleaning.
Am I right? It's too sad.
I was talking about removing the entry after wrongfully removing the device.
Because my system detect the same usb as sdb after abnormal removing.
I thought the reason is that the linux thinks the usb still present.
If you wrongfully remove the device then Linux _does_ think it is still present.
Quote:
But judging by the account of you,
If I want to detect it as sda again, the only thing I can do is just waiting for cleaning.
Am I right?
Yep (or reboot )
Quote:
It's too sad.
Well, you are to blame. As stated before: Always unmount a device before removing it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.