Fedora Linux Support Community & Resources Center
  #1  
Old 18th June 2011, 05:43 AM
csandy Offline
Registered User
 
Join Date: Mar 2011
Posts: 14
linuxfedorafirefox
shell scritp on boot

I using fedora 14 and two HDD one for O.S and other for data.
I manually mount the data HDD each time I put on my PC
I want to write a Shell Script which will mount the data HDD on boot.

pl help
Reply With Quote
  #2  
Old 18th June 2011, 06:27 AM
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,553
linuxfedorafirefox
Re: shell scritp on boot

The correct way to get filesystem to mount is to create an entry in /etc/fstab .
You need three pieces of information. The block device, the mount point directory, and the filesystem type.
Let's assume that the device is /dev/sdb1, the mount point directory is /mount/dir, and the fliesystem type is ext4 .

Then you need to add a line to fstab like:
Code:
/dev/sdb1      /mount/dir        ext4     defaults   0   0
So just start your favorit edit AS ROOT and edit the fstab file as indicate.
Be certain there is a newline at the end of the last line.

Then when you boot or execute "mount -a" as root the mount will take place.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe

Last edited by stevea; 18th June 2011 at 06:33 AM.
Reply With Quote
  #3  
Old 18th June 2011, 06:37 AM
kurtdriver Online
Registered User
 
Join Date: Jul 2005
Location: Vancouver Canada
Posts: 1,338
linuxfirefox
Re: shell scritp on boot

Wouldn't it be better to use the UUID? That way the hard drive always mounts, even if another USB device is plugged in. This will tell you the UUID of mounted discs
Code:
ls -l /dev/disk/by-uuid/
Reply With Quote
  #4  
Old 18th June 2011, 07:06 AM
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,553
linuxfedorafirefox
Re: shell scritp on boot

Quote:
Originally Posted by kurtdriver View Post
Wouldn't it be better to use the UUID? That way the hard drive always mounts, even if another USB device is plugged in. This will tell you the UUID of mounted discs
Code:
ls -l /dev/disk/by-uuid/
Yes that's a better method *IF* it's a USB or other hot-plugable device (OP never said that).

But your command description is wrong. "ls -l /dev/disk/by-uuid" tells the UUID of all partitions, with a UUID (not all filesystems support a UUID) not just mounted ones.


Also note that the fwfstab package provides a nice simple fstab editor for users who are afraid of making a mistake.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #5  
Old 18th June 2011, 08:26 AM
kurtdriver Online
Registered User
 
Join Date: Jul 2005
Location: Vancouver Canada
Posts: 1,338
linuxfirefox
Re: shell scritp on boot

You're right, silly me, I plug in a USB drive and assumed that's what the OP meant.
Reply With Quote
Reply

Tags
boot, scritp, shell

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] boot drops me into single user shell newiLuvatar F14 Development 7 17th September 2010 10:15 PM
Boot problem (GRUB shell) gzmramos Using Fedora 7 12th January 2007 11:40 PM
Boot To Shell urlcool Using Fedora 5 29th November 2006 12:43 AM
Boot to Shell instead of Xwindows? tocleora Installation, Upgrades and Live Media 2 12th December 2005 08:08 PM


Current GMT-time: 18:13 (Friday, 18-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat