LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-28-2010, 04:15 PM   #1
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Rep: Reputation: 32
Mounting external drives


Hello, this question is an extension of previous posts in relation to my removable drives. I have an external usb/ide drives and cowon iAduio7 music player. The former is always connected and latter occasionally. The first drive to be recognized gets allocated /dev/sdc1 and /dev/hdd respectively. Until ten days ago i would simply mount them manually after each boot. Recently I added them to my fstab file. It's fine only for this error message on boot.

Code:
/dev/sdc1 unexpected inconsistency.
fsck died with exit status 4
failed (code 4)
Control-D to continue

I found the following on the net

Code:
If a device is not being mounted during boot, it may be b/c the driver for that device has not been loaded yet at the time that /etc/fstab is read (and thus the device is not active yet and doesn't get mounted).  If you want to make sure it gets mounted during boot, you may need to take a look at the boot sequence for your distro and make changes as needed. Another thing you could try is adding a "mount" command of your own to one of your boot scripts. Most distros provide a file with a name like "rc.local" which gets executed late in the boot process and can be used to add your own custom commands to execute during boot

Firstly I want to know which script do you edit and does that mean I have to re-edit the fstab after creating the script.?

Here is my fstab:

Code:
[sudo] password for siawacsh: 
# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/sdd       /home/siawacsh/cowon vfat defaults 
/dev/sdc1      /home/siawacsh/myhome ext3 defaults     0        3
/dev/sdb2       /               ext3    errors=remount-ro 0       1
/dev/sdb1       none            swap    sw              0       0
/dev/scd0       /media/cdrom0   udf,iso9660 user,noauto     0       0
siawacsh@debian:~$
Remember sdc1 is the external drive, and sdd the music player.

I have attached the removable drives to directories mhyome and cowon.
 
Old 01-28-2010, 04:19 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
Have you tried attaching the drives to /mnt or /media then creating symlinks to /home?

That's what I usually do, because that's how I was taught.
 
Old 01-29-2010, 02:12 PM   #3
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
Can you show me how to create symlinks?

Many thanks.
 
Old 01-29-2010, 03:00 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
ln -s

man ln
 
Old 01-30-2010, 11:50 AM   #5
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
OK, i took out /dev/sdc and the cowon music player from fstab. I then created a directory in /mnt/cool_master. So when I do

df -h

Code:
siawacsh@debian:~$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sdb2              97G  3.3G   88G   4% /
tmpfs                 3.0G     0  3.0G   0% /lib/init/rw
udev                   10M  996K  9.1M  10% /dev
tmpfs                 3.0G     0  3.0G   0% /dev/shm
/dev/sdc1             294G  166G  113G  60% /mnt/cool_master
/dev/sdd1             294G  166G  113G  60% /media/disk
siawacsh@debian:~$

Then I tried to create a soft link for cool_master in my home directory.
Code:
ln -s /mnt/cool_master /myhome
But as you can see i have all the permissions but when I try to access via the gnome there is pad lock on it.

Code:
ls -l
total 0
lrwxrwxrwx 1 siawacsh siawacsh 16 2010-01-30 17:52 cool_master -> /mnt/cool_master
Am i on the right train of thought? I am assuming a soft link will make accessing my external drive more secure than having to browse /mnt on the root file system.?

Last edited by siawash; 01-30-2010 at 11:58 AM.
 
Old 01-30-2010, 05:30 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,321
Blog Entries: 28

Rep: Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141Reputation: 6141
If the directory you want to symlink to is /media/foo

Open a terminal and navigate to the directory in which you want the symlink to be. If it's your home directory, you are already there.

Then type

ln -x /media/foo

That will create a folder in your home directory called "foo" which links to /media/foo.

From your home directory, if the device is mounted, instead of typing

cd /media/foo

you can go to foo by typing

cd foo.

You can learn more by going to the Slackbook and reading section 9.3. (Just do a text search of "symlink.")

Hope this helps.
 
Old 01-30-2010, 09:36 PM   #7
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
Thanks to you I managed to do this. However, can you still tell me if there are any security issues with this way of accessing the drives.?

I mean, your not supposed to access the root file system on a regular basis as a normal user, are you?

Hence why I thought mounting it to another directory on a home drive to be safer..

Do let me know your thoughts.
 
Old 01-30-2010, 09:48 PM   #8
siawash
Member
 
Registered: Jun 2004
Location: Ireland
Distribution: Zorin 6
Posts: 589

Original Poster
Rep: Reputation: 32
BTW do you know how to treat such file names

I AUDIO7 as it appears in gnome. Another words how to refer to them on the terminal given the terminal does not understand spaces.?
 
  


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
Mounting external hard drives for RHEL someshpr Linux - Hardware 3 11-23-2009 01:23 PM
mounting external drives thelonius Linux - Hardware 2 04-01-2007 09:08 AM
Mounting USB drives (external HD and two at once) jrdioko Linux - Software 4 07-25-2006 06:40 PM
Mounting External DVDs, Flash Drives, etc. depam Linux - Software 4 02-09-2006 03:07 PM
mounting external hard drives Moebius Linux - Newbie 5 06-19-2004 08:39 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 10: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