Creating Filesystems(cont'd)
--Creating an ext2 filesystem--
The command for this is mke2fs. Again, you have to
be root to run this, and the same advice applies to
those of you who get the "command not found" error
message because mke2fs is in /sbin as well.
The options for mke2fs are far too numerous to list here, so I'll just
list the ones that we are going to use:
-c Check the device for bad blocks before creating the
file system, using a fast read-only test.
-v Verbose execution.
Again, checking the device is never a bad idea, and I always like verbose
output just because it helps in case something goes wrong. The format is
almost identical to the mkswap command:
/sbin/mke2fs -c -v
This time, mine on /dev/hdb14 would be:
/sbin/mke2fs -c -v /dev/hdb14
This step then spits out a bunch of garbage, and took about a minute and a
half (a little over a minute of which was the bad block checking). Here's
what came out:
[root@half-life ddipaolo]# /sbin/mke2fs -c -v /dev/hdb14
mke2fs 1.15, 18-Jul-1999 for EXT2 FS 0.5b, 95/08/09
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
131616 inodes, 263056 blocks
13152 blocks (5.00%) reserved for the super user
First data block=0
9 block groups
32768 blocks per group, 32768 fragments per group
14624 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376,
Running command: badblocks -b 4096 -s /dev/hdb14 263056
Checking for bad blocks (read-only test): done
Writing inode tables: done
Writing superblocks and filesystem accounting information: done
Your messages of course, will vary, depending upon how big of a partition
you created, and whether or not you put the "-c" flag on the mke2fs call.
I see no reason why you wouldn't though.
And, basically, we're done. To use this brand new partition with its
fresh new filesystem, all you have to do is mount it. As an example, I'll
mount this at /mnt/temp and copy some files to it just to show you.
[root@half-life ddipaolo]# mkdir /mnt/temp
[root@half-life ddipaolo]# mount /dev/hdb14 /mnt/temp
[root@half-life ddipaolo]# cp ~/*rpm /mnt/temp/
[root@half-life ddipaolo]# ls /mnt/temp
Eterm-backgrounds-0.9-2.i386.rpm licq-0.81-1.i386.rpm
NVIDIA_GLX-0.9-2.i386.rpm licq-data-1.6-1.noarch.rpm
NVIDIA_kernel-0.9-2.i386.rpm lost+found
ORBit-0.5.0-1.i386.rpm lpr-0.48-1.i386.rpm
ORBit-devel-0.5.0-1.i386.rpm mc-4.5.40-2.i386.rpm
SDL-1.1.2-1.i386.rpm mdkrpm
audiofile-0.1.9-1.i386.rpm mtv-1.1.1.0-1.i386.rpm
enlightenment-0.16.4-1.i386.rpm ncurses-5.0-12.i386.rpm
esound-0.2.15-1.i386.rpm nmap-2.53-1.i386.rpm
esound-devel-0.2.15-1.i386.rpm nmap-frontend-0.2.53-1.i386.rpm
fnlib-0.5-1.i386.rpm oregano-0.16.1-1.i386.rpm
fnlib-devel-0.5-1.i386.rpm plugger-3.2-1.i386.rpm
gaim-0.9.15-1.i386.rpm popt-1.5-6x.i386.rpm
gaim-0.9.18-1.i386.rpm qt-2.1.0-4.beta1.i386.rpm
gkrellm-0.9.8-1.i386.rpm rp7_linux20_libc6.i386.b2.rpm
gkrellm-0.9.8-1mdk.i686.rpm rpm-3.0.4-6x.i386.rpm
gmc-4.5.40-2.i386.rpm samba-2.0.7-20000425.i386.rpm
gnapster-1.3.9-1.i386.rpm spice-rhcn-3f5-3.i386.rpm
gnome-libs-1.0.53-1.i386.rpm vim-athena-rhcn-5.0-1.i386.rpm
gnome-libs-devel-1.0.53-1.i386.rpm wine-20000430-7.i386.rpm
gtkicq-0.62-1.i386.rpm xmms-1.0.1-1.i386.rpm
imlib-1.9.8-1.i386.rpm xmms-devel-1.0.1-1.i386.rpm
imlib-cfgeditor-1.9.8-1.i386.rpm xmms-esd-1.0.1-1.i386.rpm
imlib-devel-1.9.8-1.i386.rpm xmms-gnome-1.0.1-1.i386.rpm
Wow, I have far too many RPMs in my home directory. :) Guess that means
it's time for me to go clean that out, because we are DONE!
Send me feedback - Danny "Strike" DiPaolo
Would you like to have your article published online? Send them in to newfiles@linuxnewbie.org
|