LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   USB format in ubuntu from terminal (https://www.linuxquestions.org/questions/linux-newbie-8/usb-format-in-ubuntu-from-terminal-4175426204/)

rambolinuxbuddy 09-08-2012 01:47 AM

USB format in ubuntu from terminal
 
Hello all,

I am new to this ubuntu 10.04.
I want to format my USB from terminal.
by command "mount" i came to know that my USB is vfat file system.

so please can anybody tel me how to format USB of vfat file system from terminal?

and if possible please let me know how to format USB of any file system type?

hoping for quick reply.

DavidMcCann 09-08-2012 12:16 PM

The command mkfs will put a filing system on a device. If the USB stick was /dev/sdb1, then
mkfs -t ext2 /dev/sdb1
would give it a Linux system
mkfs -t vfat /dev/sdb1
a Windows one.

You could also use Gparted, if that's installed, instead of using a terminal.

rambolinuxbuddy 09-09-2012 11:30 PM

thank you for the reply.
but you did not tel me that how to format the Pen Drive in ubuntu.
I want to format my pen drive from terminal.

when I insert pen drive and give command "mount" it shows that pendrive is vfat and you are telling ext2.

I am very confuse after reading your reply..
plz help me out understanding your reply.

kurrupt 09-09-2012 11:45 PM

what hes trying to say is if you are just going to use it on linux based systems. You can use ext2. Other then that vfat can be read across all platforms.

If you plug it in and type in "mount" and you see it in the list, the first thing you must do is use the unmount command to disconnect. Also make note on the /dev/* path.

using the command: mkfs -t vfat /dev/sdb1 will wipe everything off the USB drive.


Quote:

Originally Posted by DavidMcCann (Post 4775714)
The command mkfs will put a filing system on a device. If the USB stick was /dev/sdb1, then
mkfs -t ext2 /dev/sdb1
would give it a Linux system
mkfs -t vfat /dev/sdb1
a Windows one.

You could also use Gparted, if that's installed, instead of using a terminal.


rambolinuxbuddy 09-10-2012 12:12 AM

thank you.

I will try it out and will let you know.
whether its working or not.

one more thing I would like to ask is when we give "mount" command I get as follow:-

#mount
...
/dev/sdb on /media/New Volume type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush)
...
"New Volume" is my pen drive name.
there I can see that its showing type as "vfat".
so my question is whether I should use ext3 or vfat to format.??????


(I know I am asking to many questions. :()
please help me out.

rambolinuxbuddy 09-10-2012 04:32 AM

I tried above command..

Now I can not copy anything to my pen drive.
its all root permission.

please help me out.
its very urgent.

rubankumars 09-10-2012 07:20 AM

Open Disk utility from menu --applications---
Select your device and give unmount the partition.
Then select format the partition.Select partition type as fat32
In the resulting dialog box check take ownership of filesystem option.
Give yes and it will be formatted.
You can read and write to it.

In linux when you format a device it automatically makes the device partition readable and writable only for root.
For pendrive don't use ext2,ext3 etc.,
Use only fat32

rambolinuxbuddy 09-10-2012 07:43 AM

thank you for the reply.

I followed the steps and now my pen drive is working ..:-)

Thank you so much rubankumars ..:-)

BTW, do you know how to do it from terminal?

rambolinuxbuddy 04-24-2013 03:30 AM

Pen drive is not getting detected
 
When I put my pen drive on USb port it is not getting detected.Can anybody help.


All times are GMT -5. The time now is 09:04 PM.