11 April 2013

How to Mount, Unmount and Format USB pen drive using Terminal in Ubuntu/Linux Mint

81 comments

Q: How do I control my USB pen drive from terminal in Ubuntu/Linux Mint


Ans:

Mounting USB pen drive


1. In Ubuntu desktop, the USB pen drive will be detected and mounted automatically. In Ubuntu server command line terminal, a message will appear to notice you that some information about the USB pen drive that has been plug in or alternatively you can use fdisk command to check whether USB has been mounted or not. Here is sample

how to mount usb drive in ubuntu using terminal

1.a. If you get same output as mine then you can get mount location by using mount command

mount USB drive in Linux Mint

2. If Step 1 didn't work for you, then run dmesg command to identify the correct device name corresponding to the USB pen drive

$ dmesg

[19197.235469] sd 25:0:0:0: [sdb] Write Protect is off
[19197.235476] sd 25:0:0:0: [sdb] Mode Sense: 0b 00 00 08
[19197.236972] sd 25:0:0:0: [sdb] No Caching mode page present
[19197.236982] sd 25:0:0:0: [sdb] Assuming drive cache: write through
[19197.242047] sd 25:0:0:0: [sdb] No Caching mode page present
[19197.242055] sd 25:0:0:0: [sdb] Assuming drive cache: write through
[19197.279672] sdb: sdb1 --> Device name
[19197.282401] sd 25:0:0:0: [sdb] No Caching mode page present
[19197.282406] sd 25:0:0:0: [sdb] Assuming drive cache: write through
[19197.282410] sd 25:0:0:0: [sdb] Attached SCSI removable disk
[19199.953227] usb 2-1.1: USB disconnect, device number 28

2.a. Create Mount Point

$ mkdir -p /media/usb

2.b. Mount USB pen drive

$ sudo mount /dev/sdb1 /media/usb

Unmounting USB pen drive


1. To unmount a USB device simply run the following command

$ sudo umount /dev/sdb1

OR

$ sudo umount /media/usb

NOTE: /media/usb is a mount point.

Formatting USB pen drive


1. First make sure that USB device is not mounted, if it is then unmount it.

2. Format USB device in fat32 format

$ sudo mkfs.vfat /dev/sdb1

Note: You can use mkfs.ext3 to format to ext3 filesystem.

Caution: Enter your device name correctly otherwise it will wip out your entire data.

3. Format and change the Label of the USB drive.

$ sudo mkfs.vfat -n 'sandeep' /dev/sdb1

That's it.
Enjoy :)


If You Liked This Post Please Take a Time To Share This Post

You May Also Like...

81 comments:

  1. What do you it will wip out all of my data? If I don't type the correct device will it format my whole hard disk drive or just the USB?

    ReplyDelete
  2. May I have your email address am a newbie on linux and I need a guru like yourself to help me along the way.

    ReplyDelete
  3. This command $ sudo mkfs.vfat -n 'sandeep' /dev/sdb1 can be run if you are suduers rigth?Or can we run this as root?

    ReplyDelete
    Replies
    1. if we have root permission then only we can run this command

      Delete
  4. Thanks admin for this Informative Post. It may be useful for me.
    Promotional usb Flash Drives

    ReplyDelete
  5. It was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity! I will be back soon for updates.

    Working at college paper writing service

    ReplyDelete
  6. what should i do if again same error occur after running dmesg command ,here sdb1 shows but after mount it error message sdb1 does not exit found

    ReplyDelete
  7. Good article on mount and unmount pendrive online information.

    ReplyDelete
  8. I find some very helpful answers here. Having been also wondering on how to format USB pen drive using terminal in Ubuntu, I can say that this post has been of great assistance to me. Thanks a lot.
    Help Write My Coursework

    ReplyDelete
  9. Thanks for sharing. This is awesome.

    ReplyDelete
  10. I can now confidently mount, unmount, and format mu USB stick on my own using terminal on ubuntu/ linux mint and I would like to thank the author of this document for sharing this educative information with us. I have found a permanent solution to my USB disk issues. I can now transfer my research papers written by professional writers who are offering Literature Review Writing Help without worrying about my files being destroyed by a virus.

    ReplyDelete
  11. Your post have a very nice topic, and the content have been written in a way that one understands without any challenge. It would be very nice to see more of this kind of information once more. Great
    Decorativel wall bracket

    ReplyDelete
  12. Thanks admin for this Informative Post. It may be useful for me.
    Jio TV

    ReplyDelete
  13. What if we don't have root permission,will this trick work or not.

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. I can now confidently mount, unmount, and format mu USB stick on my own using terminal on ubuntu/ linux mint

    ReplyDelete
  16. Here you can buy best pen dives. PTron Idrive High Speed 16GB 3 in 1 OTG Pen Drive Lightning Micro USB For IOS And Android SmartPhones.

    ReplyDelete
  17. Following the given manufacturer’s guidelines which mounting and unmounting USB drives helps in preventing them from spoiling. Many of the data corruption occurrences are associated with incorrect use of the USB drive. These guidelines will be very useful to me and to anyone else who is interested in using them. Application Essay for University Entrance

    ReplyDelete
  18. Tubemate 2.2.5 is a software to watch and download videos online on Youtube very quickly and conveniently. This application is provided completely free

    ReplyDelete
  19. Thank you very much. This is really a nice message.

    ReplyDelete
  20. Great. These words can impress any one at any time. Thanks for this article. Amazing.

    ReplyDelete
  21. Well done. Thanks for sharing this article. This is something have to make cheer. Great work.

    ReplyDelete
  22. Increasing your bench press will Unlock Your Hip Flexors Review also increase the amount of muscle mass you have on your entire body! It's true... and it's because of 2 reasons. First, when you keep lifting more and more weight, your body must add muscle mass so that it can handle that additional stress (weight) you're placing on it. And second, heavy intense lifts like the bench press releases anabolic hormones into your bloodstream... things like testosterone and human growth hormone. These are the male muscle builders that help you pack on muscle.The bench press is not just about boosting your ego, having a head turning upper body, or about the ability to push people around on the field.When done correctly (which most people don't) the bench press uses every single muscle in your body. You stimulate the chest, shoulders, triceps, biceps, your back and even your LEGS.It's a fact that compound exercises that involve the most muscle groups give you the most results in the least amount of time. It's because you're using ALL of your muscles at the same time.And honestly... no upper body exercise involves more muscles and becomes more of a full body exercise then the bench press. So if you don't have a lot of time you can spend in the gym... focusing on the bench press is a sure-fire way that you're getting an intense, good workout in for your whole body!Why Many People Fail To Focus On Improving Their Bench...Maybe you know someone that struggles with this exercise. And the way they deal with it is by ignoring it. Or they say it's an over-rated lift.The problem with this mentality is that by skipping this mass building exercise... they're depriving their body of anabolic hormones that could be helping then pack on muscle mass. And they're not placing enough demands on their body so that they can gain muscle.

    https://nomorescamreviews.com/unlock-your-hip-flexors-review/

    ReplyDelete
  23. This comment has been removed by the author.

    ReplyDelete
  24. Nice blog!!

    Thank you for sharing information blog relates to pen drive online

    ReplyDelete
  25. Buy Dissertation Services are of an exceptional ideal to ensure you acquire desirable scores in your Book Review Writing Services and Buy Essays Online at an affordable price.

    ReplyDelete
  26. This comment has been removed by the author.

    ReplyDelete
  27. You will be at no risk, as Acadecraft, one of the best accessibility testing companies, we follows entire guidelines for while accessing content. We meet the requirement of users for the best Testing Service with assistive tools for all platforms.

    ReplyDelete
  28. Pro Dissertation Writing is here to provide quality Best Dissertation Writing Services UK to help students getting over the pressure situation. Pro Dissertation Writing is one of the best Top UK Writing Services providing companies based in the United Kingdom.

    ReplyDelete
  29. Pro Dissertation Writing is here to provide quality Best Dissertation Writing Services UK to help students getting over the pressure situation. Pro Dissertation Writing is one of the best Top UK Writing Services providing companies based in the United Kingdom.

    ReplyDelete
  30. Skip Hire Leeds offers the best price skip hire in Leeds Guaranteed. Our Price Promise ensures that we beat any like for like skip hire quote. Compare Prices Now!

    ReplyDelete
  31. Especially when most apprentices are stuck with so many things at the same time, they begin to think “Take my online exams

    ReplyDelete
  32. App development company Houston Is Being Named On The Top App Developers Usa On Business Of Apps. Leveraging a deep technical acumen & highly refined development processes, We provides a ultra rapid & cost effective delivery cycle, a key success factor in such a rapidly evolving market place. We have consulted and developed over 400+ Applications, not only in United States but throughout the world including Europe, Australia and Middle East.

    ReplyDelete
  33. This comment has been removed by the author.

    ReplyDelete
  34. Extremely lovely and informative post. I appreciate you giving such fantastic content, admin. Visit Relax CBD products For You.

    ReplyDelete
  35. Absolutely the blog post is amazing. I requesting you admin to publish more this informative article post. Being a health persons and working at 24/7 home care agency love to read these posts.

    ReplyDelete
  36. An informative read! Your guide on controlling USB pen drives in Ubuntu/Linux Mint is invaluable. Just as we navigate tech complexities, parents might find themselves managing tasks while ensuring essentials like a stick teether are at hand.

    ReplyDelete
  37. cross platform app development companyApps Cre8ve, a prominent cross-platform app development company. Our innovative solutions transcend conventional boundaries, offering a dynamic approach to your biotech discussions. Elevate your assignment with the expertise of Apps Cre8ve.

    ReplyDelete
  38. Please share more blogs like this.
    American Medical Supplies is a national leader in the provision of superior medical equipment. With a dedication to quality, we provide a wide selection of state-of-the-art healthcare solutions, enabling people to live healthier lives. Transform your health with DME of America.

    ReplyDelete
  39. Learning to mount, unmount, and format a USB pen drive using Terminal in Ubuntu/Linux Mint can be daunting. With Content Writing Mastery, we simplify these technical steps into clear, easy-to-follow guides, empowering users with essential Linux skills.

    ReplyDelete
  40. Controlling your USB pen drive from the terminal in Ubuntu/Linux Mint requires commands like "lsblk" and "mount" for management. Similarly, integrating Security Guard Services ensures the protection of sensitive data on your devices, providing an extra layer of security against unauthorized access or data theft in both physical and digital environments.

    ReplyDelete