LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   mke2fs what is the command to format a FAT23 or SWAP hd? (https://www.linuxquestions.org/questions/linux-newbie-8/mke2fs-what-is-the-command-to-format-a-fat23-or-swap-hd-719001/)

linus72 04-14-2009 06:51 AM

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.

r3sistance 04-14-2009 06:55 AM

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.

dasy2k1 04-14-2009 06:56 AM

mkswap for swap,
not sure about fat32

onebuck 04-14-2009 07:41 AM

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.

linus72 04-15-2009 12:43 PM

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?

repo 04-15-2009 12:50 PM

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


All times are GMT -5. The time now is 05:02 PM.