LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 03-23-2010, 07:00 AM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,541
Blog Entries: 28

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
mke2fs -t vfat created an ext2 file system


Hello

I wanted to put a label on a USB memory stick's FAT32 file system. mkfs.vfat is not available on my Slackware 13.0 system and slackpkg search mkfs.vfat found nothing. Back in December 09, linuxlover.chaitanya suggested using mke2fs -t vfat in this LQ post. I tried it -- and got a ext2 file system
Code:
root@CW8:~# mke2fs -t vfat -L CHARLES8G /dev/sdc1
[After mounting via Thunar ...]
root@CW8:~# df -hT /dev/sdc1
Filesystem    Type    Size  Used Avail Use% Mounted on
/dev/sdc1     ext2    7.4G   17M  7.0G   1% /media/CHARLES8G
Why did that happen?

Best

Charles
 
Old 03-23-2010, 07:04 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,907

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Hi,

Why don't you use mkdosfs?

Regards
 
Old 03-23-2010, 07:12 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,226

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
Quote:
Originally Posted by catkin View Post
Why did that happen?
Because you used mke2fs - and you made an e(xt)2 fs.
No surprise there. Read the manpage before doing anything potentially destructive.
 
Old 03-23-2010, 07:22 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,856

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
AFAIK there is no valid -t option and mke2fs can not create a vfat filesystem. I am curious if it really did create a vfat filesystem in the other thread.
 
Old 03-23-2010, 07:36 AM   #5
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 11,146
Blog Entries: 3

Rep: Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406Reputation: 1406
Hi,

Quote:
excerpt from 'man mke2fs';
NAME
mke2fs - create an ext2/ext3/ext4 filesystem

SYNOPSIS
mke2fs [ -c | -l filename ] [ -b block-size ] [ -f fragment-size ] [ -g blocks-per-group ] [ -G
number-of-groups ] [ -i bytes-per-inode ] [ -I inode-size ] [ -j ] [ -J journal-options ] [ -N
number-of-inodes ] [ -n ] [ -m reserved-blocks-percentage ] [ -o creator-os ] [ -O fea-
ture[,...] ] [ -q ] [ -r fs-revision-level ] [ -E extended-options ] [ -v ] [ -F ] [ -L vol-
ume-label ] [ -M last-mounted-directory ] [ -S ] [ -t fs-type ] [ -T usage-type ] [ -U UUID ] [
-V ] device [ blocks-count ]

mke2fs -O journal_dev [ -b block-size ] [ -L volume-label ] [ -n ] [ -q ] [ -v ] external-jour-
nal [ blocks-count ]

DESCRIPTION
mke2fs is used to create an ext2, ext3, or ext4 filesystem, usually in a disk partition.
device is the special file corresponding to the device (e.g /dev/hdXX). blocks-count is the
number of blocks on the device. If omitted, mke2fs automagically figures the file system size.
If called as mkfs.ext3 a journal is created as if the -j option was specified.

The defaults of the parameters for the newly created filesystem, if not overridden by the
options listed below, are controlled by the /etc/mke2fs.conf configuration file. See the
mke2fs.conf(5) manual page for more details.
Quote:
excerpt from 'man mke2fs';

-t fs-type
Specify the filesystem type (i.e., ext2, ext3, ext4, etc.) that is to be created. If
this option is not specified, mke2fs will pick a default either via how the command was
run (for example, using a name of the form mkfs.ext2, mkfs.ext3, etc.) or via a default
as defined by the /etc/mke2fs.conf(5) file. This option controls which filesystem
options are used by default, based on the fstypes configuration stanza in
/etc/mke2fs.conf(5).

If the -O option is used to explicitly add or remove filesystem options that should be
set in the newly created filesystem, the resulting filesystem may not be supported by
the requested fs-type. (e.g., "mke2fs -t ext3 -O extents /dev/sdXX" will create a
filesystem that is not supported by the ext3 implementation as found in the Linux ker-
nel; and "mke2fs -t ext3 -O ^has_journal /dev/hdXX" will create a filesystem that does
not have a journal and hence will not be supported by the ext3 filesystem code in the
Linux kernel.)
The user would have to modify '/etc/mke2fs.conf' to use alternate FS. Why?
 
Old 03-23-2010, 07:51 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,541
Blog Entries: 28

Original Poster
Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by bathory View Post
Why don't you use mkdosfs?
Thanks bathory

I did but cfdisk did not show the label created by mkdosfs's -n option. Thunar found it OK, displayed it and used it when creating the temporary mountpoint/directory in /media.

That's why I was looking for an alternative way of creating the label, hoping it might be more widely visible.
 
Old 03-23-2010, 07:52 AM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,541
Blog Entries: 28

Original Poster
Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by syg00 View Post
Because you used mke2fs - and you made an e(xt)2 fs.
No surprise there. Read the manpage before doing anything potentially destructive.
Thanks for your concern, syg00

I had read the man page, it documented the -t option and the device held no data.
 
Old 03-23-2010, 07:58 AM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,541
Blog Entries: 28

Original Poster
Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by onebuck View Post
The user would have to modify '/etc/mke2fs.conf' to use alternate FS. Why?
I wasn't surprised that it didn't work (was half-hopeful, based on the December thread's advice given and reported success -- and that the ext2 utilities work on ext3 and ext4) but was surprised that it did not halt on error when an invalid -t option value was given.
 
  


Reply

Tags
ext2, vfat


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
Getting short file names on mounted VFAT file system? manorina Linux - Software 1 09-03-2009 02:51 AM
created ext2 file system on unpartitioned disk nozzer Linux - Newbie 3 09-03-2008 02:35 PM
about the ext2 file system chenxiaopang Linux - Kernel 0 11-25-2007 02:18 AM
ext2 file system information vipulc Linux - General 4 08-19-2006 07:48 AM
How to print out ext2 File System justmehere Linux - General 2 08-02-2005 08:13 PM


All times are GMT -5. The time now is 01:55 PM.

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