LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How can I permanent mount an exixting Partition (https://www.linuxquestions.org/questions/linux-general-1/how-can-i-permanent-mount-an-exixting-partition-135652/)

mwj 01-17-2004 01:35 AM

How can I permanently Mount an exixting Partition
 
Dear Professionals

I have RH-9 installed in my system. 40GB H drive (IDE). I installed Linux on 25 GB ( hda1)
I have second 14 GB with ext-3 type partition (Free). hda2
I want to use this partition for backup and in place of existing /home directory.There are home folders of 20-30 users (SMB USERS) on existing /home . I want to shift these user folders on that free partition as well to lessen the load.
I have to mount every time that partition as I start the system with
Mountt /dev/hda2 /mnt/home
(/mnt/home is empty folder where i mount that partition)
How can I permanently mount that free partition in my system??????

mikshaw 01-17-2004 01:53 AM

If you want to change /home to hda2:

Log in as root
Mount hda2 at /mnt/home
Move all /home files to /mnt/home

edit /etc/fstab with an entry something like this:
Code:

/dev/hda2    /home    ext3    defaults    00
umount /mnt/home
mount /home

reader 01-17-2004 02:16 AM

Or
 
Mount as you do, and then 'vi mtab fstab'. Copy the 'home' line from mtab and paste it in fstab. Voilą !

mwj 01-19-2004 05:03 AM

Dear Both members
Bravo
I did as u said and it is woking as HEAVEN.
Thanks a lot
At the mment ,Instead of making hda2 /home , I mounted hda2 on /mnt/home.
Now, I planed to get all of my existing user Folders on existing /home. I will take backup of all these folders on /mnt/home daily ,to secure the data.
How is this approach???????
I need yr feed back.

thegeekster 01-19-2004 07:10 AM

Quote:

Originally posted by mwj
...Now, I planed to get all of my existing user Folders on existing /home. I will take backup of all these folders on /mnt/home daily ,to secure the data.
How is this approach???????
I need yr feed back.

Sounds like a good plan :) ........You can run a daily backup as a cron job automatically, so you don't have to remember to do so each time........after all, that's what computers are for, to make life easier for us. ;)

mwj 01-19-2004 11:31 PM

Thanks for yr feed back.
I know very little abt making backup automatically.Would u please let me know the exact procdure????

thegeekster 01-20-2004 04:37 PM

Basiclly, you add a script that will execute the backup procedure on a daily basis. This can be a shell, bash or a perl script, which is placed in the system's cron directory, or any directory you specify in crontab using the 'crontab -e' command. At least that's how it's done in Slack. I'm not familiar with how it's done in RH...................Read the manpages for crontab (man crontab), man crond, man run-parts, to get an idea of how cron jobs are run. Also run 'crontab -e', which is where the cron jobs are placed. It may already have some entries which you can look at. For example, heres what my crontab looks like:
Code:

# If you don't want the output of a cron job mailed to you, you have to direct
# any output to /dev/null.  We'll do this here since these jobs should run
# properly on a newly installed system, but if they don't the average newbie
# might get quite perplexed about getting strange mail every 5 minutes. :^)
#
# Run the hourly, daily, weekly, and monthly cron jobs.
# Jobs that need different timing may be entered into the crontab as before,
# but most really don't need greater granularity than this.  If the exact
# times of the hourly, daily, weekly, and monthly cron jobs do not suit your
# needs, feel free to adjust them.
#
# Run hourly cron jobs at 47 minutes after the hour:
47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null
#
# Run twice daily cron jobs at 4:50 and 16:50 (4:50pm) every day:
50 4,16 * * * /usr/bin/run-parts /etc/cron.twicedaily 1> /dev/null
#
# Run daily cron jobs at 4:40 every day:
40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null
#
# Run weekly cron jobs at 4:30 on the first day of the week:
30 4 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null
#
# Run monthly cron jobs at 4:20 on the first day of the month:
20 4 1 * * /usr/bin/run-parts /etc/cron.monthly 1> /dev/null

Note: The twice daily entry is one I added, which runs every 12 hours, while the rest are the defaults that come with Slack. RedHat might have something a little different, but this should give you an idea of what to expect. And the default editor for 'crontab -e' is vi. If you want to use a different editor, then you'll need to add a VISUAL variable in your login script, ~/.bashrc (or whatever you're using). For example, I prefer pico, so I added this at the bottom of ~/.bashrc:

VISUAL = 'pico -w'
export VISUAL

You will also need to know something about shell scripting. Go to this thread which shows you where to go to get started on bash scripting...........................You can find some ready-made backup scripts that might suit your purposes. Go to SourceForge's search page and enter 'backup script' (no quotes). Make sure there's a check mark next to "Require All Words". This will give you quite a few choices. If you choose a perl program, you'll need to know enough about perl so you can edit it for your particular needs.

This should get you started. Hope this helps. :)
---thegeekster

------------
PS: You can also find a couple of backup scripts from GNU's Free Software Directory: Backup

thegeekster 01-21-2004 07:57 PM

Bash Programming-Introduction HOW-TO
 
Hey mwj,

Here's a good start on Bash scripting, and it also uses examples creating a backup script. This is from TLDP (The Linux Documentation Project), which is usualy installed on most Linux distros (under /usr/docs/)......or you can download all the HOWTOs in html format - Linux-html-HOWTOs - and put them in your /usr/doc/ directory. You can also get the htmls in a single-page format, too - Linux-html-single-HOWTOs............Just look for 'Bash-Prog-Intro-HOWTO'

I prefer using the html format because it's easier to navigate and skip around from one section to another. ;)

:)
---thegeekster

mwj 01-22-2004 10:59 PM

Hi thegeekster
Thanks alot for all of yr time and preciuse peaces of guidlines.I am already on my way toward bash programing after yr previuos post.
I have boohmarked alll those links and also down loaded the material u sugested .Now I will take some time to go through it. Pray for success.
mwj

thegeekster 01-23-2004 12:48 AM

LOL.........you're welcome. Glad you find it uselful :)

Shell scripting is an excellent intro into the world of programming in general, as well as a great way to learn more about what Unix/Linux is capable of.......................If you like it enough and decide to go on to more advanced programming, you'll have an easier time understanding the concepts involved and will be able to spend more time on learning the new syntax for the other language(s). ;)

The best of luck to ya :)


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