LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 04-14-2009, 06:51 AM   #1
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
mke2fs what is the command to format a FAT23 or SWAP hd?


OK-if mke2fs does EXT2, what is the command for FAT32 and Swap?
Thanks.
 
Old 04-14-2009, 06:55 AM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 216Reputation: 216Reputation: 216
Coming from a red-hat background, I personally use the commands like 'mkfs.ext3' and 'mkfs.vfat' (FAT 32). Not sure if those are universal or not tho, never done swap.

Last edited by r3sistance; 04-14-2009 at 06:58 AM.
 
Old 04-14-2009, 06:56 AM   #3
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 958

Rep: Reputation: 35
mkswap for swap,
not sure about fat32
 
Old 04-14-2009, 07:41 AM   #4
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,713
Blog Entries: 27

Rep: Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055Reputation: 2055
Hi,

Code:
excerpt from 'man mkfs';

NAME
       mkfs - build a Linux file system

SYNOPSIS
       mkfs [ -V ] [ -t fstype ] [ fs-options ] filesys [ blocks ]

DESCRIPTION
       mkfs  is  used to build a Linux file system on a device, usually a hard
       disk partition.  filesys is either the device  name  (e.g.   /dev/hda1,
       /dev/sdb2).   blocks  is  the  number of blocks to be used for the file
       system.

       The exit code returned by mkfs is 0 on success and 1 on failure.

       In actuality, mkfs is simply a front-end for the  various  file  system
       builders (mkfs.fstype) available under Linux.  The file system-specific
       builder is searched for in a number of directories like perhaps  /sbin,
       /sbin/fs,  /sbin/fs.d,  /etc/fs,  /etc  (the precise list is defined at
       compile time but at least contains /sbin and /sbin/fs), and finally  in
       the  directories  listed  in the PATH environment variable.  Please see
       the file system-specific builder manual pages for further details.
Code:
excerpt from 'man mkswap';

 mkswap - set up a Linux swap area

SYNOPSIS
       mkswap [-c] [-vN] [-f] [-p PSZ] [-L label] device [size]

DESCRIPTION
       mkswap sets up a Linux swap area on a device or in a file.

       (After  creating  the  swap  area, you need the swapon command to start
       using it. Usually swap areas are listed in /etc/fstab so that they  can
       be  taken  into  use  at  boot time by a swapon -a command in some boot
       script.)

       The device argument will usually be a disk  partition  (something  like
       /dev/hda4  or /dev/sdb7) but can also be a file.  The Linux kernel does
       not look at partition Id's, but many installation scripts  will  assume
       that partitions of hex type 82 (LINUX_SWAP) are meant to be swap parti-
       tions.  (Warning: Solaris also uses this type. Be careful not  to  kill
       your Solaris partitions.)
The 'man command' is available to you online or from the command line if you have 'man' installed.
 
Old 04-15-2009, 12:43 PM   #5
linus72
LQ Guru
 
Registered: Jan 2009
Location: Gordonsville-AKA Mayberry-Virginia
Distribution: PocketWriter/MinimalX
Posts: 5,087

Original Poster
Rep: Reputation: 337Reputation: 337Reputation: 337Reputation: 337
OK-what is the command to mount swap-
Code:
/dev/hdc looks like swapspace
-not mounted mount: you must specify the filesystem type
So, what do I do?
I tried swapspace/swap, etc.
What is the proper command?
 
Old 04-15-2009, 12:50 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
you don't mount a swapspace, since it has no filessystem
To start using a swap partition you can enter this command.

Code:
swapon /dev/hda2
To get a list
Code:
swapon -s
 
  


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
pls help me !!!!1cannot format with mke2fs sambyte Linux - Newbie 5 03-01-2006 06:02 AM
cant format partition using mke2fs linuxbh Linux From Scratch 2 04-04-2005 11:08 AM
linux swap format tedist_god Linux - Software 6 09-19-2003 11:02 AM
Does mke2fs format in FAT32 format? blueleft Linux - General 2 08-09-2003 08:03 AM
Swap file format (by accident, honest) and boot maxb Linux - General 3 08-01-2003 04:27 AM


All times are GMT -5. The time now is 11: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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration