Solved

Some Easy Questions ??????

Posted on 2004-08-03
6
414 Views
Last Modified: 2010-08-05
i have linux redhat9.0
I Know That The Purpose Of The File /etc/rc.d/rc.local Is That You Just Enter Some Commands In It And These Commands Will Be Execute After The Booting Process Of Linux.

If I Put
mount -t vfat /dev/hda1 /mnt/windows  
this command in /etc/rc.d/rc.local
then my c: (Drive) will be mounted each time when i start linux.

I want that
when i boot my linux then it will terminate or formate my d: (hda5)
each time when linux start.
so for that i must put the command
mount -t vfat /dev/hda5 /mnt/windows  
In    rc.local
now what is the next command to format or completely delete the partition hda5 or D:

If You Dont Know About This Stupidity
Then Just Tell Me The Process Of Formating any vfat drive from linux redhat 9.0


thanxxxxxxxxx you all



0
Comment
Question by:bbaiub
6 Comments
 
LVL 3

Expert Comment

by:pYrania
ID: 11702131
it highly depends on the filesystem you want to format the partition with

for ext3 use the following:
mke2fs -j /dev/hda5
mount -t ext3 /dev/hda5 /mnt/windows

for vfat you might use:
mkfs -t vfat /dev/hda5
mount -t vfat /dev/hda5 /mnt/windows
0
 
LVL 17

Expert Comment

by:owensleftfoot
ID: 11702465
parted -s rm /dev/hda5 will delete the hda5 partition.
0
 
LVL 20

Accepted Solution

by:
Gns earned 500 total points
ID: 11702626
Um, why do you put the first mount in rc.local? Something wrong with setting it to automatically mount in /etc/fstab?
Oh, and why have a scratch area that you zero each time you start linux?
... And you don't have to mount on /mnt/windows ... you can well mount it anyplace you like. Say you want to mount /dev/hda1 ("c:") on /mnt/win_c and /dev/hda5 on /mnt/win_d, the (first time only) you need create these directories
mkdir /mnt/win_c
mkdir /mnt/win_d
... Then you put something like
/dev/hda1 /mnt/win_c vfat defaults 0 0
in /etc/fstab so that mount -a can handle it at boot, and use a slightly modified variant of pYranias vfat advice for the scratchpad like
mkfs -t vfat /dev/hda5
mount -t vfat /dev/hda5 /mnt/win_d
in /etc/rc.d/rc.local ... You might have an entry for it in fstab too, so that it is easier to handle (umount /mnt/win_d ... etc), something like
/dev/hda5 /mnt/win_d vfat defaults,noauto 0 0
where the "noauto" option make sure it _doesn't_ get mounted automatically, and thus won't be in the way for the fs-creation.

But I'm really curious as to why you would want this type of setup.

-- Glenn
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 3

Expert Comment

by:pYrania
ID: 11702776
maybe he hasn't heard about tmpfs yet.
0
 
LVL 20

Expert Comment

by:Gns
ID: 11703091
Might be it. Hopefully we'll get to know though.

-- Glenn
0
 
LVL 1

Expert Comment

by:rdoctane
ID: 11708784
mkfs.vfat -F FAT-size

if you dont specify it'll give you 12 or 16 bit...if you want fat32, you have to specify it

~joe~
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question