LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-08-2012, 01:47 AM   #1
rambolinuxbuddy
LQ Newbie
 
Registered: Sep 2012
Posts: 16

Rep: Reputation: Disabled
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.
 
Old 09-08-2012, 12:16 PM   #2
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,138

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
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.
 
Old 09-09-2012, 11:30 PM   #3
rambolinuxbuddy
LQ Newbie
 
Registered: Sep 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
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.
 
Old 09-09-2012, 11:45 PM   #4
kurrupt
Member
 
Registered: Jul 2004
Distribution: Debian, Ubuntu, FreeBSD, RHEL
Posts: 202

Rep: Reputation: 31
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 View Post
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.
 
Old 09-10-2012, 12:12 AM   #5
rambolinuxbuddy
LQ Newbie
 
Registered: Sep 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
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.
 
Old 09-10-2012, 04:32 AM   #6
rambolinuxbuddy
LQ Newbie
 
Registered: Sep 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
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.
 
Old 09-10-2012, 07:20 AM   #7
rubankumars
Member
 
Registered: Oct 2010
Location: india
Distribution: debian 8,debian 9,slackware 14.2
Posts: 158

Rep: Reputation: 12
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
 
Old 09-10-2012, 07:43 AM   #8
rambolinuxbuddy
LQ Newbie
 
Registered: Sep 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
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?

Last edited by rambolinuxbuddy; 09-11-2012 at 01:47 AM.
 
Old 04-24-2013, 03:30 AM   #9
rambolinuxbuddy
LQ Newbie
 
Registered: Sep 2012
Posts: 16

Original Poster
Rep: Reputation: Disabled
Pen drive is not getting detected

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


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
sending raw data to a USB device from terminal in ubuntu raphtor Linux - Networking 1 01-25-2010 04:37 AM
How to format SD cards using FDISK (any terminal ) VISUAL LINKS lost dragon Linux - Hardware 2 08-14-2009 05:27 PM
Ubuntu terminal look like linux mint terminal? caa1980 Ubuntu 6 08-13-2009 12:16 PM
Ubuntu 8.04 Terminal - Can you make the terminal window transparent with a wallpaper? bparkerson04 Linux - Newbie 6 02-17-2009 05:12 PM
partition format using the terminal Mr.mick-duck Linux - General 3 09-22-2006 06:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration