LinuxQuestions.org
Review your favorite Linux distribution.
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, 02: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, 01:16 PM   #2
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,189

Rep: Reputation: 813Reputation: 813Reputation: 813Reputation: 813Reputation: 813Reputation: 813Reputation: 813
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:30 AM   #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-10-2012, 12:45 AM   #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, 01: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, 05: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, 08:20 AM   #7
rubankumars
Member
 
Registered: Oct 2010
Distribution: Slackware 14.1,debian 7
Posts: 111

Rep: Reputation: 11
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, 08: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 02:47 AM.
 
Old 04-24-2013, 04: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:37 AM
How to format SD cards using FDISK (any terminal ) VISUAL LINKS lost dragon Linux - Hardware 2 08-14-2009 06:27 PM
Ubuntu terminal look like linux mint terminal? caa1980 Ubuntu 6 08-13-2009 01:16 PM
Ubuntu 8.04 Terminal - Can you make the terminal window transparent with a wallpaper? bparkerson04 Linux - Newbie 6 02-17-2009 06:12 PM
partition format using the terminal Mr.mick-duck Linux - General 3 09-22-2006 07:38 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration