Author Topic: (SOLVED!)How do I mount an external hard-drive within my /home partition?  (Read 1486 times)

Offline Dragynn

  • Hero Member
  • *****
  • Posts: 1436
  • Abide.
Hey y'all,

I just finished networking two computers on my network at home. NFS is working great, but I need to share an external hard-drive from one machine to the other. The info I have from here in the forum, is that I need to mount it in the /home section somewhere, as opposed to /media where it is now. How do I change the mount point?

This is probably a simple silly question, but i've been working on these machines loading PCLOS on one and doing all the configuring plus loading Citrix so Mama can work on the new one for several hours now, and this last little bit is escaping me (I started on the tequila a short while ago fer medicinal purposes, so my geek skillz may be slightly compromised a bit...) ;D
« Last Edit: November 22, 2010, 04:10:54 PM by Dragynn »
This aggression will not stand man.

Offline Dragynn

  • Hero Member
  • *****
  • Posts: 1436
  • Abide.
Re: How do I mount an external hard-drive within my /home partition?
« Reply #1 on: November 22, 2010, 07:46:40 AM »
How about a symbolic link  to the external drive (/media/disk?) placed into the /home/where-ever?
>Steve  :)

Thanks _Steve, i'll try that, can I use any kind of image or file for making the link? Just an icon say?
This aggression will not stand man.

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11540
  • ----IOFLU----
Re: How do I mount an external hard-drive within my /home partition?
« Reply #2 on: November 22, 2010, 10:42:21 AM »
Hey y'all,

I just finished networking two computers on my network at home. NFS is working great, but I need to share an external hard-drive from one machine to the other. The info I have from here in the forum, is that I need to mount it in the /home section somewhere, as opposed to /media where it is now. How do I change the mount point?

This is probably a simple silly question, but i've been working on these machines loading PCLOS on one and doing all the configuring plus loading Citrix so Mama can work on the new one for several hours now, and this last little bit is escaping me (I started on the tequila a short while ago fer medicinal purposes, so my geek skillz may be slightly compromised a bit...) ;D

Medicinal tequila, the best kind!  ;D

For starters you don't mount an external hard drive; you mount a filesystem or filesystems on one or more partitions on that drive. To know just how to do that one needs to know the number of partitions and the filesystem used. Next where in /home/<you> do you wish the mount to be? I mount two partitions on /home/polack/Documents and /home/polack/Documents2. The /etc/fstab entries for these are as follows;

[root@littleboy ~]# cat /etc/fstab |grep Documents
Code: [Select]
LABEL=TR5-Documents     /home/polack/Documents  ext3    rw,user,noauto,exec,noatime     0 0
LABEL=Documents2        /home/polack/Documents2 ext3    rw,user,noauto,exec,noatime     0 0


Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Dragynn

  • Hero Member
  • *****
  • Posts: 1436
  • Abide.
Re: How do I mount an external hard-drive within my /home partition?
« Reply #3 on: November 22, 2010, 11:28:53 AM »
Hey y'all,

I just finished networking two computers on my network at home. NFS is working great, but I need to share an external hard-drive from one machine to the other. The info I have from here in the forum, is that I need to mount it in the /home section somewhere, as opposed to /media where it is now. How do I change the mount point?

This is probably a simple silly question, but i've been working on these machines loading PCLOS on one and doing all the configuring plus loading Citrix so Mama can work on the new one for several hours now, and this last little bit is escaping me (I started on the tequila a short while ago fer medicinal purposes, so my geek skillz may be slightly compromised a bit...) ;D

Medicinal tequila, the best kind!  ;D

For starters you don't mount an external hard drive; you mount a filesystem or filesystems on one or more partitions on that drive. To know just how to do that one needs to know the number of partitions and the filesystem used. Next where in /home/<you> do you wish the mount to be? I mount two partitions on /home/polack/Documents and /home/polack/Documents2. The /etc/fstab entries for these are as follows;

[root@littleboy ~]# cat /etc/fstab |grep Documents
Code: [Select]
LABEL=TR5-Documents     /home/polack/Documents  ext3    rw,user,noauto,exec,noatime     0 0
LABEL=Documents2        /home/polack/Documents2 ext3    rw,user,noauto,exec,noatime     0 0




Gotcha, i'm getting closer, been playing around in terminal using mount command and was able to mount it where I wanted, but no file access as it normally has when the system mounts it under /media.

It's a firewire HD, there is only one large partition that takes up the whole drive, formatted as ntfs. It was originally bought and used just to backup media files and docs etc. before wiping a Windoze box and re-installing (this is why it's ntfs), it has a large store of music and pictures, I use it as the media library for Clementine.

My problem comes from trying to share it using NFS with Mama's computer that I just converted to PCLOS Zen-mini. All the other shares work great between both computers, but as-mounted by the system in /media, it won't let me share it with her computer. I've been wanting to wipe out her Windoze partition completely, but she has quite a few gigs of music and other media that need to be saved, and unfortunately her somewhat cheapie mobo doesn't have a firewire port, so I can't connect the drive directly. I was hoping that maybe if I could run the drive through my box, share the drive with hers, that I could then drag-n-drop transfer all those files to the firewire HD that way, and thus avoid burning a whole bunch of DVD's just to save those files.

There are other ways around this I guess, was just hoping this might be a very handy and simple way to do it, and also an extra bit of storage for her, ultimately I wouldn't mind moving all the media we both have onto that drive and using it to serve the files to either box.

*forgot to add*: the drive is /dev/sdb1,  /etc/mtab will show an entry for it when mounted.
« Last Edit: November 22, 2010, 11:32:25 AM by Dragynn »
This aggression will not stand man.

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11540
  • ----IOFLU----
Re: How do I mount an external hard-drive within my /home partition?
« Reply #4 on: November 22, 2010, 12:36:19 PM »

*forgot to add*: the drive is /dev/sdb1,  /etc/mtab will show an entry for it when mounted.

Show me the /etc/mtab entry, and we should be able to see the permissions and mount options. We should then be able to adapt them to an /etc/fstab entry for mounting at the location of your choice, with all the proper read/write access.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Dragynn

  • Hero Member
  • *****
  • Posts: 1436
  • Abide.
Re: How do I mount an external hard-drive within my /home partition?
« Reply #5 on: November 22, 2010, 12:51:33 PM »

*forgot to add*: the drive is /dev/sdb1,  /etc/mtab will show an entry for it when mounted.

Show me the /etc/mtab entry, and we should be able to see the permissions and mount options. We should then be able to adapt them to an /etc/fstab entry for mounting at the location of your choice, with all the proper read/write access.

Code: [Select]
/dev/sdb1 /media/New\040Volume fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
Thanks O-P, i'm still trying to earn my ninja yellow-belt  :D, but I borked it for a while last night and couldn't even read or mount the drive fer a bit and don't want to do that again ;) .  I'm learning though, I go through here frequently and deconstruct/reverse-engineer a lot of your answers to folks to find out why they worked, and then play around with the commands and options myself and see how they apply to other situations, it's kind of a back-***wards way of learning things, but it works....still the little boy at heart, taking things apart to see how they work instead of reading manuals ya know :D

This aggression will not stand man.

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11540
  • ----IOFLU----
Re: How do I mount an external hard-drive within my /home partition?
« Reply #6 on: November 22, 2010, 01:55:05 PM »

*forgot to add*: the drive is /dev/sdb1,  /etc/mtab will show an entry for it when mounted.

Show me the /etc/mtab entry, and we should be able to see the permissions and mount options. We should then be able to adapt them to an /etc/fstab entry for mounting at the location of your choice, with all the proper read/write access.

Code: [Select]
/dev/sdb1 /media/New\040Volume fuseblk rw,nosuid,nodev,allow_other,blksize=4096 0 0
Thanks O-P, i'm still trying to earn my ninja yellow-belt  :D, but I borked it for a while last night and couldn't even read or mount the drive fer a bit and don't want to do that again ;) .  I'm learning though, I go through here frequently and deconstruct/reverse-engineer a lot of your answers to folks to find out why they worked, and then play around with the commands and options myself and see how they apply to other situations, it's kind of a back-***wards way of learning things, but it works....still the little boy at heart, taking things apart to see how they work instead of reading manuals ya know :D



Some of those items look pretty foreign to me, but not having any NTFS stuff myself, the options may have the same effect as older ones, just worded differently. This being all trial and error at this point, let's give this a shot. First item is to safely unmount the present mount point, then disconnect/turn off the external drive. Having only eSATA or USB connected external drives to compare to, I'm assuming they have a switch on firewire cases so they can just be turned off, rather than physically detached, if you wish.

In your /home/<you> directory, create a new directory named Test. As root, open /etc/fstab in your favorite editor, and add this line:

/dev/sdb1   /home/<you>/Test   fuseblk   rw,noauto,user,nosuid,nodev,allow_other,blksize=4096   0 0

Replace <you> with your normal user name. Save the file, and close the editor. Reconnect/turn on the external drive.

The mount options noauto,user, should now allow you to mount the partition on the external drive as a normal user. In a terminal, as your normal user;

[<you>@localhost ~]$ mount /dev/sdb1               <Enter>

[<you>@localhost ~]$ ls -l Test                   <Enter>

If the mount was successful, you should see a list of all the files and directories, as well as the permissions attached.

Post your results.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Dragynn

  • Hero Member
  • *****
  • Posts: 1436
  • Abide.
Re: How do I mount an external hard-drive within my /home partition?
« Reply #7 on: November 22, 2010, 02:34:42 PM »
Okay, went through that, when I turned the power to the HD back on, and error message popup stating "Can't mount" appeared with this message "Invalid mount option when attempting to mount the volume 'New Volume'."

Here are my actions in terminal:

Code: [Select]
[bob@localhost ~]$ mkdir /home/bob/Test
[bob@localhost ~]$ mount /dev/sdb1
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

[bob@localhost ~]$ ls -l Test
total 0
[bob@localhost ~]$

Yep, the firewire HD has a switch, it's pretty much identical to a USB HD as well in every other respect, data transfer is a lot faster than USB though (and it was cheap, 20.00 bucks shipping and all off E-bay).

Here's a portion of /var/log/messages that relates to an instance of the system mounting it as it normally does under /media if that helps:

Code: [Select]
Nov 22 13:41:13 localhost hald: mounted /dev/sdb1 on behalf of uid 500
Nov 22 13:41:13 localhost ntfs-3g[13925]: Version 2010.1.16 external FUSE 28
Nov 22 13:41:13 localhost ntfs-3g[13925]: Mounted /dev/sdb1 (Read-Write, label "New Volume", NTFS 3.1)
Nov 22 13:41:13 localhost ntfs-3g[13925]: Cmdline options: rw,nosuid,nodev,uhelper=hal,locale=en_US.UTF-8
Nov 22 13:41:13 localhost ntfs-3g[13925]: Mount options: rw,nosuid,nodev,uhelper=hal,silent,allow_other,nonempty,relatime,fsname=/dev/sdb1,blkdev,blksize=4096
Nov 22 13:41:13 localhost ntfs-3g[13925]: Ownership and permissions disabled

So hal's doing the mounting I guess, maybe a config file somewhere to edit where it mounts it?

« Last Edit: November 22, 2010, 02:37:24 PM by Dragynn »
This aggression will not stand man.

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11540
  • ----IOFLU----
Re: How do I mount an external hard-drive within my /home partition?
« Reply #8 on: November 22, 2010, 03:36:27 PM »
Okay, went through that, when I turned the power to the HD back on, and error message popup stating "Can't mount" appeared with this message "Invalid mount option when attempting to mount the volume 'New Volume'."

Here are my actions in terminal:

Code: [Select]
[bob@localhost ~]$ mkdir /home/bob/Test
[bob@localhost ~]$ mount /dev/sdb1
mount: wrong fs type, bad option, bad superblock on /dev/sdb1,
       missing codepage or helper program, or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

[bob@localhost ~]$ ls -l Test
total 0
[bob@localhost ~]$

Yep, the firewire HD has a switch, it's pretty much identical to a USB HD as well in every other respect, data transfer is a lot faster than USB though (and it was cheap, 20.00 bucks shipping and all off E-bay).

Here's a portion of /var/log/messages that relates to an instance of the system mounting it as it normally does under /media if that helps:

Code: [Select]
Nov 22 13:41:13 localhost hald: mounted /dev/sdb1 on behalf of uid 500
Nov 22 13:41:13 localhost ntfs-3g[13925]: Version 2010.1.16 external FUSE 28
Nov 22 13:41:13 localhost ntfs-3g[13925]: Mounted /dev/sdb1 (Read-Write, label "New Volume", NTFS 3.1)
Nov 22 13:41:13 localhost ntfs-3g[13925]: Cmdline options: rw,nosuid,nodev,uhelper=hal,locale=en_US.UTF-8
Nov 22 13:41:13 localhost ntfs-3g[13925]: Mount options: rw,nosuid,nodev,uhelper=hal,silent,allow_other,nonempty,relatime,fsname=/dev/sdb1,blkdev,blksize=4096
Nov 22 13:41:13 localhost ntfs-3g[13925]: Ownership and permissions disabled

So hal's doing the mounting I guess, maybe a config file somewhere to edit where it mounts it?



Hal does the mounting if there is no entry in the fstab. Now, we edit the line to change the fstab line to something acceptable. Item one, the fuseblk part of the line gets changed to ntfs-3g, to get rid of the wrong fs type error. Then the options get edited to;           rw,user,noauto,exec,relatime,umask=0         so in the end the line should look like this.

/dev/sdb1   /home/bob/Test   ntfs-3g   rw,user,noauto,exec,relatime,umask=0   0 0

For ease, you could comment out the old line, or delete it, then just copy/paste this one into your fstab. Save the file, then try mounting the partition again.
Old-Polack

Of what use be there for joy, if not for the sharing thereof?



Lest we forget...

Offline Dragynn

  • Hero Member
  • *****
  • Posts: 1436
  • Abide.
Re: How do I mount an external hard-drive within my /home partition?
« Reply #9 on: November 22, 2010, 04:10:23 PM »
SUCCESS!!!!!!! ;D ;D ;D ;D

I wrote the new lines to fstab, but it still didn't want to mount, but it threw up a new error message:
Code: [Select]
ntfs-3g: Failed to access volume '/dev/sdb1': No such file or directory

ntfs-3g 2010.1.16 external FUSE 28 - Third Generation NTFS Driver
XATTRS are on, POSIX ACLS are off

Copyright (C) 2005-2007 Yura Pakhuchiy
Copyright (C) 2006-2009 Szabolcs Szakacsits
Copyright (C) 2007-2009 Jean-Pierre Andre
Copyright (C) 2009 Erik Larsson

Usage:    ntfs-3g [-o option[,...]] <device|image_file> <mount_point>

Options:  ro (read-only mount), remove_hiberfile, uid=, gid=,
          umask=, fmask=, dmask=, streams_interface=.
          Please see the details in the manual (type: man ntfs-3g).

Example: ntfs-3g /dev/sda1 /mnt/windows

Ntfs-3g news, support and information:  http://ntfs-3g.org

So I looked at that for a bit, then I put on my O-P hat and opened the terminal as root and typed this:
Code: [Select]
[root@localhost bob]# ntfs-3g /dev/sdb1 /home/bob/Test
And it worked! Mounted the drive in the "Test" directory. I then opened PCC and configured it to share, opened Mama's PCC and found it there and mounted it and VOILA-PRESTO-HOT DIGGETY DANG!

I now have  an external hard drive, that uses an Apple connection protocol, formatted with a Windows file system (ntfs) running on a fully networked Linux machine that is sharing the files with another linux machine!

Priceless! Only PCLOS baby, there is NOTHING this distro can't do!

Thanks for all your help O-P, couldn't have got there without you! And also all the hundreds of other posts from the users and devs in this forum that I have read.

I'm marking this one solved, it's Miller time and make that two fer O-P on me! ;)

This aggression will not stand man.