Find the answer to your Linux question:
Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By Rubberman
Hi, I am trying to figure out how I am going to mount my external HD to the /etc/fstab . I use multiple HD/USB drives simultaneouly which are connected to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2008
    Location
    Co.Mayo, Ireland
    Posts
    33

    Question Mounting a drive using the /etc/fstab


    Hi,

    I am trying to figure out how I am going to mount my external HD to the /etc/fstab.

    I use multiple HD/USB drives simultaneouly which are connected to the computer. So if I add an entry such as /dev/sdb /mnt/backupDrive to the /etc/fstab, then any first connected drive could possibly be mounted to that directory when the system gives that drive a device name as sdb, right?

    So how can I tell /etc/fstab to make sure it is the HD that I want to connect to, rather that a USB stick, say?

    I'm using crontab to backup data to that drive using the mounted entry in the /etc/fstab file.

    Thanks much appreciated

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    I always name the file systems on my drives so I can configure /etc/fstab to use the name instead of the device or GUID - allowing me to move the data to a new device and not change fstab. IE:
    Code:
    LABEL=afs-ts02          /mnt/ts02               ext4    defaults        1 2
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Oct 2008
    Location
    Co.Mayo, Ireland
    Posts
    33
    Thanks for your reply.

    How can I name the systems on my drive? Are your using the label of your device that is assigned to it?

    Thanks

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,753
    Good question. I either label it when I create the file system using the -L volname option, or after the fact using (depending upon the file system) commands such as /sbin/dosfslabel, /sbin/e2label, /sbin/ntfslabel, etc. You can also label swap partitions with the mkswap command's -L option. The e2label command works for ext2/3/4 file systems (all based upon ext2).
    dougie1809 likes this.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Just Joined!
    Join Date
    Oct 2008
    Location
    Co.Mayo, Ireland
    Posts
    33
    Thanks alot for your reply.

    That helped alot. Its handy to get the proper label rather than using the dev name.

    Thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •