LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 09-21-2008, 12:59 PM   #16
mhg
Member
 
Registered: Apr 2007
Location: Utah
Distribution: BodhiLinux
Posts: 205

Original Poster
Rep: Reputation: 30

Sorry Nylex, I missed your last post. Here are some results:

mike@mike-desktop:~$ mount
/dev/sda6 on / type ext3 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-19-generic/volatile type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
gvfs-fuse-daemon on /home/mike/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=mike)
/dev/sda5 on /media/New Volume type fuseblk (rw,nosuid,nodev,noatime,allow_other,blksize=4096)
/dev/sdb5 on /mnt type ext3 (rw)
mike@mike-desktop:~$

So I can see here my /dev/sdb5. I can not browse to it to use it.


here is ls -l:

mike@mike-desktop:~$ ls -l
total 10044
-rw------- 1 mike mike 404770 2008-09-20 12:22 bookmarks.html
drwxr-xr-x 3 mike mike 4096 2008-09-19 08:14 Desktop
drwxr-xr-x 2 mike mike 4096 2008-09-14 12:32 Documents
drwxr-xr-x 2 mike mike 4096 2008-09-19 08:14 downloads
lrwxrwxrwx 1 mike mike 26 2008-09-14 06:26 Examples -> /usr/share/example-content
-rw-r--r-- 1 mike mike 1110512 2008-09-19 10:09 gnucash backup
-rw-r--r-- 1 mike mike 170 2008-09-19 08:09 gnucash backup.20080919080944.log
-rw-r--r-- 1 mike mike 170 2008-09-19 08:09 gnucash backup.20080919080948.log
-rw-r--r-- 1 mike mike 1139 2008-09-19 09:34 gnucash backup.20080919093001.log
-rw-r--r-- 1 mike mike 1110162 2008-09-19 08:09 gnucash backup.20080919093415.xac
-rw-r--r-- 1 mike mike 170 2008-09-19 09:34 gnucash backup.20080919093418.log
-rw-r--r-- 1 mike mike 959 2008-09-19 10:09 gnucash backup.20080919100845.log
-rw-r--r-- 1 mike mike 1110374 2008-09-19 09:34 gnucash backup.20080919100946.xac
-rw-r--r-- 1 mike mike 170 2008-09-19 10:09 gnucash backup.20080919100949.log
drwxr-xr-x 4 mike mike 4096 2008-09-19 08:10 Music
drwxr-xr-x 2 mike mike 4096 2008-09-14 12:32 Pictures
drwxr-xr-x 2 mike mike 4096 2008-09-14 12:32 Public
-rw-r--r-- 1 mike mike 48151 2008-09-21 08:44 Screenshot--dev-sdb - GParted.png
-rw-r--r-- 1 mike mike 18556 2008-09-21 08:45 Screenshot-mike@mike-desktop: ~.png
drwxr-xr-x 2 mike mike 4096 2008-09-14 12:32 Templates
-rw-r--r-- 1 mike mike 6379397 2008-09-19 08:09 translog.20080919080516.log
drwxr-xr-x 2 mike mike 4096 2008-09-14 12:32 Videos
mike@mike-desktop:~$


mike@mike-desktop:~$ ls -l / grep mnt
ls: cannot access grep: No such file or directory
ls: cannot access mnt: No such file or directory
/:
total 88
drwxr-xr-x 2 root root 4096 2008-09-14 12:49 bin
drwxr-xr-x 3 root root 4096 2008-09-14 12:54 boot
lrwxrwxrwx 1 root root 11 2008-09-14 06:19 cdrom -> media/cdrom
drwxr-xr-x 13 root root 14040 2008-09-21 08:43 dev
drwxr-xr-x 124 root root 12288 2008-09-21 09:15 etc
drwxr-xr-x 3 root root 4096 2008-09-14 06:26 home
drwxr-xr-x 2 root root 4096 2008-07-02 04:16 initrd
lrwxrwxrwx 1 root root 33 2008-09-14 00:29 initrd.img -> boot/initrd.img-2.6.24-19-generic
drwxr-xr-x 16 root root 4096 2008-09-20 17:38 lib
drwx------ 2 root root 16384 2008-09-14 06:19 lost+found
drwxr-xr-x 4 root root 4096 2008-09-21 08:37 media
drwxr-xr-x 4 root root 4096 2008-09-21 10:32 mnt
drwxr-xr-x 2 root root 4096 2008-07-02 04:16 opt
dr-xr-xr-x 131 root root 0 2008-09-21 02:19 proc
drwxr-xr-x 8 root root 4096 2008-09-14 12:48 root
drwxr-xr-x 2 root root 4096 2008-09-14 12:51 sbin
drwxr-xr-x 2 root root 4096 2008-09-21 10:39 sdb5
drwxr-xr-x 2 root root 4096 2008-07-02 04:16 srv
drwxr-xr-x 12 root root 0 2008-09-21 02:19 sys
drwxrwxrwt 15 root root 4096 2008-09-21 10:33 tmp
drwxr-xr-x 11 root root 4096 2008-07-02 04:18 usr
drwxr-xr-x 15 root root 4096 2008-07-02 04:34 var
lrwxrwxrwx 1 root root 30 2008-09-14 00:29 vmlinuz -> boot/vmlinuz-2.6.24-19-generic
mike@mike-desktop:~$

I tried every combination I could think of for the ls -l / |grep mnt. Probably not getting the correct command typed?

Thank You!
 
Old 09-21-2008, 01:09 PM   #17
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by mhg View Post
/dev/sdb5 on /mnt type ext3 (rw)
Right, we are convinced that the partition is mounted on /mnt. So, any files you create in /mnt are being written to that partition, since "mounting" just means to attach the file system on a device (here, /dev/sdb5) to the "filesystem tree".

Quote:
drwxr-xr-x 4 root root 4096 2008-09-21 10:32 mnt
Quote:
I tried every combination I could think of for the ls -l / |grep mnt. Probably not getting the correct command typed?
You missed the pipe ("|"), but never mind, since you ran "ls -l /" anyway and the relevant output is there:

Quote:
drwxr-xr-x 4 root root 4096 2008-09-21 10:32 mnt
You should be able to read the contents at least. Not sure if your GUI file manager is preventing you from even doing that (and if so, I don't know what the cause is).
 
Old 09-21-2008, 01:15 PM   #18
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 88
I feel a little explanation may help (apologies if you aready know this, but it's common misunderstanding for new Linux users who are experienced in Windows).
  • In Linux, you don't actually see the "drives" as you do in Windows, when moving from directory to directory. Instead, you see a single file system, spanning out from / (root).
  • If a drive (or partition) is mounted on a particular directory, ls and similar commands will only show you the directory, but any files saved to this directory will actually end up on the drive.
  • You can actually mount a drive on a directory that already contains files. The files on the drive will "overlay" those already in the directory (but not delete them). When the drive is unmounted, you will be able to see them once more.

For instance, on my system, my home directory is on a separate partition - df shows the device name, usage and mount point:
Code:
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda8             10365264    894536   8944200  10% /home
While mount shows the options with which the partition has been mounted:

Code:
/dev/sda8 on /home type ext3 (rw)
However, if I enter ls -l /home, there's no sign of the partition:

Code:
total 20
drwx------  2 root root 16384 2008-01-20 21:27 lost+found
drwxr-xr-x 55 rob  rob   4096 2008-09-21 14:42 rob
 
Old 09-21-2008, 01:39 PM   #19
mhg
Member
 
Registered: Apr 2007
Location: Utah
Distribution: BodhiLinux
Posts: 205

Original Poster
Rep: Reputation: 30
OK. I can see the mnt folder is (close to) the size of the hard drive I installed.

Keep in mind I am a new guy here. I expected to see the hard drive as a "new volume", or some sort of thing like that, that I could browse to.

Sooooo. Now I have a folder/directory named mnt that is approx. 180 gig. I really feel ridiculous/foolish (Linux seems to have a way of doing that to me), I can see the folder under "filesystem", but can not create a folder within it, or save anything to it. For example, if I want to save a OO document, I can not browse to this directory to save to it.

I can not create a link to it, or to the "testdir" within it. I'm sorry for the thickness here, but I can't seem to figure out how to use this hard drive. My plan was to use this extra drive to store (and access!) music, photos and such. Is there something right in front of me that I am missing? I do know how to browse to folders, I know how to save to folders. I can find this mnt folder, but can not save to it. I can not copy a file to it. What am I missing?

All I am trying to accomplish, is add a hard drive to increase my storage capacity.

Many thanks for the help and all the patience.
 
Old 09-21-2008, 01:46 PM   #20
mhg
Member
 
Registered: Apr 2007
Location: Utah
Distribution: BodhiLinux
Posts: 205

Original Poster
Rep: Reputation: 30
Robhogg,

Do I need to somehow mount this drive in my home folder?

I almost have an idea about how I do not see, or have to see, the separate drive. But as you can see from my previous post, I am unable to write to this drive/directory, or create a directory within it, or create a link to it etc.

Thank You
 
Old 09-21-2008, 01:50 PM   #21
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I have a partition on my disk that I use for music and stuff and what I do is mount it under my home directory. The permissions and everything seem to be taken care of. Edit: I assume that GUI file managers will work ok as well, but I never use them so I don't know. Anyway, to do this, you'll need to create a directory in your home to use as the mount point and then add an entry to your /etc/fstab. My fstab entry looks like this:

/dev/hdd3 /home/nick/shared ext3 auto,rw 1 2

There's a guide to understanding and editing fstab here. It's a text file, so any text editor will do. You'll need to use sudo to get privileges to edit the file (i.e. run something like "sudo gedit /etc/fstab" to open the file with gedit).

Last edited by Nylex; 09-21-2008 at 01:55 PM.
 
Old 09-21-2008, 02:25 PM   #22
mhg
Member
 
Registered: Apr 2007
Location: Utah
Distribution: BodhiLinux
Posts: 205

Original Poster
Rep: Reputation: 30
OK. I am remembering some of this. I finally got the gedit /etc/fstab command. Problem is, my /dev/sdb5 is not listed.

I tried to "mount /dev/sdb5/home/mike, but got the message that sdb5 was not listed in fstab.

So it appears that the drive is mounted in the filesystem tree, but it is not listed in fstab. Do I have to try and manually enter it in fstab? I was thinking it would be there, and I would only edit the line.

Thanks
 
Old 09-21-2008, 02:27 PM   #23
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You don't need an entry in fstab to be able to mount partitions. However, adding an entry is useful, for instance, if you want partitions mounted automatically when the system is booted.
 
Old 09-21-2008, 02:31 PM   #24
mhg
Member
 
Registered: Apr 2007
Location: Utah
Distribution: BodhiLinux
Posts: 205

Original Poster
Rep: Reputation: 30
So how can I get this drive mounted in my home directory instead of filesystem?

When I tried mount /dev/sdb5/home/mike, I get this:

mike@mike-desktop:~$ sudo mount /dev/sdb5/home/mike
mount: can't find /dev/sdb5/home/mike in /etc/fstab or /etc/mtab
mike@mike-desktop:~$

Thanks
 
Old 09-21-2008, 02:35 PM   #25
mhg
Member
 
Registered: Apr 2007
Location: Utah
Distribution: BodhiLinux
Posts: 205

Original Poster
Rep: Reputation: 30
Am I on the right track with fstab like this?

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda6
UUID=1a123196-9a11-42fc-9cec-90e3f8a8945e / ext3 relatime,errors=remount-ro 0 1
# /dev/sda7
UUID=9b419357-bdb8-4f6f-9300-685b61dabc7e none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/sdb5 /home/mike ext3 auto,rw
 
Old 09-21-2008, 02:54 PM   #26
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Firstly, you're missing the entries for the last two columns and secondly, you probably don't want to mount that partition on /home/mike, you probably want a directory in your home directory as the mount point (as I have, I use the directory called shared).
 
Old 09-21-2008, 04:17 PM   #27
mhg
Member
 
Registered: Apr 2007
Location: Utah
Distribution: BodhiLinux
Posts: 205

Original Poster
Rep: Reputation: 30
Here is what I have in fstab:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda6
UUID=1a123196-9a11-42fc-9cec-90e3f8a8945e / ext3 relatime,errors=remount-ro 0 1
# /dev/sda7
UUID=9b419357-bdb8-4f6f-9300-685b61dabc7e none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
# /dev/sdb5 /home/mike/backup ext3 auto,rw 1 2

Here is what I have going in a terminal:

mike@mike-desktop:~$ sudo mount /dev/sdb5/home/mike/backup
[sudo] password for mike:
mount: can't find /dev/sdb5/home/mike/backup in /etc/fstab or /etc/mtab

So still noting I can use.

Thanks again.
 
Old 09-21-2008, 04:21 PM   #28
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Two things:

1. Your entry for /dev/hdb5 has a # at the beginning, which means that it will be ignored (it's "commented out").

2. When you run mount, you need to put a space between the device (/dev/sdb5) and the mount point (/home/mike/backup). When you have an fstab entry, you can actually omit the mount point (i.e. "mount /dev/sdb5" should work), since mount will check the fstab file.
 
Old 09-21-2008, 04:33 PM   #29
mhg
Member
 
Registered: Apr 2007
Location: Utah
Distribution: BodhiLinux
Posts: 205

Original Poster
Rep: Reputation: 30
Here it is again:

mike@mike-desktop:~$ sudo mount /dev/sdb5
[sudo] password for mike:
Sorry, try again.
[sudo] password for mike:
mount: mount point /home/mike/backup does not exist

And my fstab:

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda6
UUID=1a123196-9a11-42fc-9cec-90e3f8a8945e / ext3 relatime,errors=remount-ro 0 1
# /dev/sda7
UUID=9b419357-bdb8-4f6f-9300-685b61dabc7e none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/sdb5 /home/mike/backup ext3 auto,rw 1 2

Can you see what I am still doing wrong?

Thank You
 
Old 09-21-2008, 05:01 PM   #30
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by mhg View Post
mount: mount point /home/mike/backup does not exist
Quote:
Can you see what I am still doing wrong?
Trying to mount to a directory that doesn't exist. Create the directory backup in /home/mike if that's the directory you want to use. You use mkdir to create directories: mkdir /home/mike/backup (or, obviously "mkdir backup" if you're in /home/mike).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Ubuntu: Installed to external hard drive; boot to primary hard drive gives error 22 dcorb62 Linux - General 7 09-05-2007 12:28 AM
Formated hard drive karolyta Linux - Hardware 1 03-25-2006 06:55 AM
So i formated my linux hard drive and tried to reinstall slackware but i get an error gbdavidx Linux - General 10 11-09-2004 05:29 PM
How to I check a Linux formated hard drive for bad sectors NewtoLinuxWorld Linux - Hardware 1 02-27-2004 04:46 AM
Second hard drive doesn't show up GreenerLinux Libranet 4 11-17-2003 05:12 PM


All times are GMT -5. The time now is 04:50 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration