LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 06-11-2013, 03:06 PM   #1
skoda
Member
 
Registered: Jun 2013
Posts: 111

Rep: Reputation: Disabled
running a bash command at linux startup


Hello,

i am currenly mounting my ntfs partition manually after my cent os started every time.
i want it to be automatically executed when linux load.
where should i put the following command?

Code:
mount -t ntfs-3g /dev/sda6 /media/ntfsd/
 
Old 06-11-2013, 03:10 PM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i think the correct way is to put an entry in /etc/fstab.

there are a few ways to skin this cat.
for the system to do it automatically, i would put it in /etc/rc.local.
for the user to do it once logged in you can put it in ~/.bash_profile.
some newer distros support a @reboot directive in the users crontab.
 
Old 06-11-2013, 03:10 PM   #3
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
No need for a script. Disk mounting is configured in the /etc/fstab file.

A google search on fstab configuration should turn up all the info you need. Good luck!
 
Old 06-11-2013, 03:53 PM   #4
skoda
Member
 
Registered: Jun 2013
Posts: 111

Original Poster
Rep: Reputation: Disabled
Thanks guys,

i ll be adding it to /etc/fstab.
 
  


Reply



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
[SOLVED] Running a command at startup? yarvin Fedora 2 03-12-2010 06:50 PM
Running a bash script at startup linker3000 Linux - Software 2 05-17-2007 10:00 PM
running a command on startup scankyfrank Linux - General 8 05-08-2005 05:03 PM
Running a command at Startup TuxTimo Linux - Newbie 6 02-27-2004 05:11 PM
Running a command on startup? flamesrock Linux - Software 5 09-06-2003 11:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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