Author Topic: [SOLVED]Keeping my local harddrives mounted?  (Read 1147 times)

Offline newbi462

  • Hero Member
  • *****
  • Posts: 629
[SOLVED]Keeping my local harddrives mounted?
« on: April 10, 2010, 12:15:57 AM »
OK my system has several hard drives and the fact that they dont mount at boot is causing problems

I need to have them mounted so each drive is always in the same place (preferably at boot) so I don't need to keep re linking. So media/disk-1,  /disk-2 and so on is always the same drive so the files are always in the same place for programs like Amarok and so on

How to I do this?

Thanks in advance!
« Last Edit: April 10, 2010, 03:26:45 PM by newbi462 »

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: Keeping my local harddrives mounted?
« Reply #1 on: April 10, 2010, 02:21:07 AM »
OK my system has several hard drives and the fact that they dont mount at boot is causing problems

I need to have them mounted so each drive is always in the same place (preferably at boot) so I don't need to keep re linking. So media/disk-1,  /disk-2 and so on is always the same drive so the files are always in the same place for programs like Amarok and so on

How to I do this?

Thanks in advance!

You start by creating mount point directories, in someplace other than /media, perhaps /mnt, or someplace in your own home directory, or even the / directory. Then you create lines for them in /etc/fstab, with the proper mount options. I use labels for each partition, which work the same as UUID numbers but are easier for us mere humans to understand.

Below is my /etc/fstab to serve as an example.

Code: [Select]
# Entry for /dev/hda3 :
LABEL=TR5-2             /                       ext3    defaults                1 1
# Entry for /dev/hda1 :
LABEL=boot200           /boot                   ext3    defaults                1 2
LABEL=TR5-Documents     /home/polack/Documents  ext3    defaults                1 2
LABEL=Documents2        /home/polack/Documents2 ext3    defaults                1 2
LABEL=share7            /share7                 ext3    rw,user,auto,exec       0 0
LABEL=share9            /share9                 ext3    rw,user,auto,exec       0 0
LABEL=movies            /movies                 ext3    rw,user,auto,exec       0 0
LABEL=movies2           /movies2                ext3    rw,user,auto,exec       0 0
LABEL=TV-1              /tv                     ext3    rw,user,auto,exec       0 0
LABEL=storage00         /zstorage00             ext3    rw,user,noauto,exec     0 0
LABEL=120backup         /zbackup                ext3    rw,user,noauto,exec     0 0
none                    /proc                   proc    defaults                0 0
# Entry for /dev/sda2 :
LABEL=swap200           swap                    swap    defaults                0 0
# Entry for /dev/sda2 :
LABEL=swap1000          swap                    swap    defaults                0 0
# Entry for /dev/sdc2 :
LABEL=swap750           swap                    swap    defaults                0 0
none                    /dev/pts                devpts  mode=0620               0 0
/dev/fd0                /mnt/floppy             auto    rw,user,noauto,exec     0 0
/dev/cdrom              /mnt/cdrom              auto    ro,user,noauto          0 0
/dev/dvd                /mnt/dvd                auto    ro,user,noauto          0 0
none                    /dev/shm                tmpfs   defaults                0 0
« Last Edit: April 10, 2010, 02:23:04 AM by old-polack »
Old-Polack

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



Lest we forget...

Online MCP

  • Sr. Member
  • ****
  • Posts: 385
Re: Keeping my local harddrives mounted?
« Reply #2 on: April 10, 2010, 07:56:43 AM »
OK my system has several hard drives and the fact that they dont mount at boot is causing problems

I need to have them mounted so each drive is always in the same place (preferably at boot) so I don't need to keep re linking. So media/disk-1,  /disk-2 and so on is always the same drive so the files are always in the same place for programs like Amarok and so on

How to I do this?

Thanks in advance!

You start by creating mount point directories, in someplace other than /media, perhaps /mnt, or someplace in your own home directory, or even the / directory. Then you create lines for them in /etc/fstab, with the proper mount options. I use labels for each partition, which work the same as UUID numbers but are easier for us mere humans to understand.

Below is my /etc/fstab to serve as an example.

Code: [Select]
# Entry for /dev/hda3 :
LABEL=TR5-2             /                       ext3    defaults                1 1
# Entry for /dev/hda1 :
LABEL=boot200           /boot                   ext3    defaults                1 2
LABEL=TR5-Documents     /home/polack/Documents  ext3    defaults                1 2
LABEL=Documents2        /home/polack/Documents2 ext3    defaults                1 2
LABEL=share7            /share7                 ext3    rw,user,auto,exec       0 0
LABEL=share9            /share9                 ext3    rw,user,auto,exec       0 0
LABEL=movies            /movies                 ext3    rw,user,auto,exec       0 0
LABEL=movies2           /movies2                ext3    rw,user,auto,exec       0 0
LABEL=TV-1              /tv                     ext3    rw,user,auto,exec       0 0
LABEL=storage00         /zstorage00             ext3    rw,user,noauto,exec     0 0
LABEL=120backup         /zbackup                ext3    rw,user,noauto,exec     0 0
none                    /proc                   proc    defaults                0 0
# Entry for /dev/sda2 :
LABEL=swap200           swap                    swap    defaults                0 0
# Entry for /dev/sda2 :
LABEL=swap1000          swap                    swap    defaults                0 0
# Entry for /dev/sdc2 :
LABEL=swap750           swap                    swap    defaults                0 0
none                    /dev/pts                devpts  mode=0620               0 0
/dev/fd0                /mnt/floppy             auto    rw,user,noauto,exec     0 0
/dev/cdrom              /mnt/cdrom              auto    ro,user,noauto          0 0
/dev/dvd                /mnt/dvd                auto    ro,user,noauto          0 0
none                    /dev/shm                tmpfs   defaults                0 0

OP,

You mentioned creating mount points in any directory except "media".  Why?

MCP

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: Keeping my local harddrives mounted?
« Reply #3 on: April 10, 2010, 10:42:10 AM »
OP,

You mentioned creating mount points in any directory except "media".  Why?

MCP

Because /media, by design, was added to the directory hierarchy as a place to mount removable media, ie optical disks, floppy disks, Zip or Jaz disks. USB sticks would qualify for it's original intent, as they basically replace the obsolete Zip and Jaz drives, as to purpose. The intent was to give these temporary short term mounts a place separate from /mnt, which was their original proper mounting place, but where longer term temporary mounting of non system hard drive data partitions also took place. As hard drives grew larger and many content specific data partitions became common, /mnt itself became crowded enough that /media, was created, to make the truly temporary mounted data easier to locate. (less sub directories)

Having HAL dynamically auto-mount everything not in fstab, and not placing the majority of ones partitions in fstab, (where they properly belong) everything gets dumped in /media, and nothing is mounted in /mnt, thereby creating the exact same mess that /media was meant to relieve. (A fine example of a bunch of "bright ideas" being implemented, ending up with a stupid result)
Old-Polack

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



Lest we forget...

Offline newbi462

  • Hero Member
  • *****
  • Posts: 629
Re: Keeping my local harddrives mounted?
« Reply #4 on: April 10, 2010, 12:57:32 PM »
Ok I take it no GUI way to do this :(

OK here is what my "fstab" file looks like

# Entry for /dev/sda1 :
UUID=c998ff21-07c9-48c0-916d-2eed5be25cf1 / ext4 defaults 1 1
# Entry for /dev/sda6 :
UUID=fc0e2d67-a1ec-4617-b6d2-d3c6509ea1cc /home ext4 defaults 1 2
none /proc proc defaults 0 0
# Entry for /dev/sda5 :
UUID=30f78e97-fcc2-4c00-a744-e7ee1474b52a swap swap defaults 0 0
none /dev/pts devpts defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0

one other other drives is

Device: sdb2
DOS drive letter: D (just a guess)
Type: NTFS-3G
Size: 98GB (14%)
Mounted

another is

Device: sdb7
Type: Journalised FS: ext3
Size: 588GB (84%)
Mounted

But I am not 100% sure what to add to the "fstab" file as mine looks a tad dif than yours I am not seeing things like label? If you could could you show e what I should add for these 2 to moint them in mnt or media under lableX and LableY and I think I will be good to go from there for all the others.

Also can you tell me how to open that file as root from my regular user or do I need to log over to root to do this?

Thanks in advance.

Offline Xero

  • Sr. Member
  • ****
  • Posts: 469
Re: Keeping my local harddrives mounted?
« Reply #5 on: April 10, 2010, 01:51:00 PM »
Hmmm. I mount my extra drives under /media most of the time, no isues. And yes, there is a GUI for it. Open the PCLOS Control Centre (forget exact name, not at that box tonight), and look for Local Disks, or something to that effect. There you can find all the drives in  the machine, including those not currently mounted, and select and mount them from there. My storage drives, for example are mounted under /media/STORAGE, and /media/MY_STUFF . You select the drive, then select mount point (can be named anything really, just make it descriptive, helps when looking for stuff :) ), and when finished, select Done,and it will ask if want to save changes to fstab, select Yes. Done. :)
There is no shame in saying "I don't know".

Offline YouCanToo

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 5381
  • Location: Lebanon, OR., USA
    • Spreading the word.......
Re: Keeping my local harddrives mounted?
« Reply #6 on: April 10, 2010, 01:57:35 PM »
Hmmm. I mount my extra drives under /media most of the time, no isues. And yes, there is a GUI for it. Open the PCLOS Control Centre (forget exact name, not at that box tonight), and look for Local Disks, or something to that effect. There you can find all the drives in  the machine, including those not currently mounted, and select and mount them from there. My storage drives, for example are mounted under /media/STORAGE, and /media/MY_STUFF . You select the drive, then select mount point (can be named anything really, just make it descriptive, helps when looking for stuff :) ), and when finished, select Done,and it will ask if want to save changes to fstab, select Yes. Done. :)

It is called "diskdrake"

My understanding of Media was that it is the mount point for things like removable media IE: flash drives etc.




Be sure to visit the NEW Knowledge Base


Linux is user-friendly- it's just picky who its friends are!

Offline menotu

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 15506
  • ┌∩┐(◕_◕)┌∩┐
Re: Keeping my local harddrives mounted?
« Reply #7 on: April 10, 2010, 02:02:33 PM »
An easy way to mount disks using GUI is from:

Have a look in the Taskbar/panel >

"Configure Your Desktop" > Advanced User Settings > Removable Devices >

Now select "Enable Automatic Mounting of Removable Media"

From there you have multiple choices to Auto-mount various drives (inc CD - USB - HDD etc)
PCLinuxOS 32bit KDE 4.10.4; kernel-3.4.11-pclos1.bfs & 64bit 3.4.38bfs; NVidia GeForce 8400GS 1GB 310.19 driver

Sony Vaio SVE1513A4ESI Laptop, Intel Core i5, 2.6GHz, 6GB RAM, 750GB, 15.6" Intel HD Graphics 4000

Offline Old-Polack

  • Administrator
  • Super Villain
  • *****
  • Posts: 11688
  • ----IOFLU----
Re: Keeping my local harddrives mounted?
« Reply #8 on: April 10, 2010, 02:18:16 PM »
newbi462:

What is on each partition, as far as content is concerned, or what name would you like for each label?

You could use the old style /dev/sdb2 type designations if you wish, but they are subject to changes now that the kernal sees all drives as /dev/sdxn, with x being the drive letter and n being the partition number.

The form is;

<device or Label><space><mount point><space><format><space><mount options><space>0<space>0

The last two zeros have to do with filesystem checks and the dump command; zero being the same meaning as n/a in a form.

As root, one would use the command;

# ntfslabel /dev/sdb2 <new kabel>

for the first partition, and;

# tune2fs -L <new label> /dev/sdb7

for the second partition.

If you are already in the root terminal use the following to edit fstab with kwrite;

# kwrite /etc/fstab

Add your lines, press Enter to start a new line, then save the file.

The mount options are comma separated and can have no spaces, from start to finish. You can see the ones I use, for Linux partitions, in my last post. There having been changes to ntfs-3g, I'm not sure of the current mount options for that partition. You'd be better waiting for those from someone that uses such partitions. As a guess, I'd say;

rw,user,noauto,umask=000,charset=utf-8

if you wanted the partition user mountable, or if auto mounted;

rw,auto,umask=000,charset=utf-8

Someone using ntfs-3g should be able to confirm if this is still correct, or if something needs to be added.
« Last Edit: April 10, 2010, 06:54:18 PM by old-polack »
Old-Polack

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



Lest we forget...

Offline newbi462

  • Hero Member
  • *****
  • Posts: 629
Re: Keeping my local harddrives mounted?
« Reply #9 on: April 10, 2010, 03:26:19 PM »
Thanks to all nice to have my drives mounted properly for once.


Offline Bald Brick

  • PCLinuxOS Tester
  • Hero Member
  • *******
  • Posts: 6470
  • I'm going South
Re: Keeping my local harddrives mounted?
« Reply #10 on: April 10, 2010, 04:57:28 PM »
There having been changes to ntfs-3g, I'm not sure of the current mount options for that partition. You'd be better waiting for those from someone that uses such partitions. As a guess, I'd say;

rw,user,noauto,umask=000,charset=utf-8

if you wanted the partition user mountable, or if auto mounted;

rw,auto,umask=000,charset=utf-8

Someone using ntfs-3g should be able to confirm if this is still correct, or if something needs to be added.

The options rw and auto aren't really needed.  Neither is mentioned in the man page of ntfs-3g, but according to man mount 8 they are filesystem independent defaults. (cat /proc/mounts will list rw unless you've specified ro. It won't list the options auto or noauto, but running umount -a and mount -a with auto specified and not specified shows that auto is still the default.)

This doesn't mean that rw and auto should be removed from all lines in /etc/fstab. Leaving them there serves as a memory aid -- and helps if another option has overridden the defaults.

Whether charset=utf-8 does anything useful I do not know. The options related to character sets have changed a lot lately. (Time for some experimenting.)
« Last Edit: April 11, 2010, 09:16:54 AM by blackbird »
Feed the trolls!
They need it!

AMD Athlon 7450 Dual-Core Processor, 7.80 GiB RAM, Nvidia GeForce GT 120/PCIe/SSE2, OpenGL/ES-version: 3.3 0 NVIDIA 295.40, SBx00 Azalia (Intel HDA) soundcard, ‎Logitech B500 webcam, SAA7146 DVB card, HDDs: Seagate 250824AS, Western Digital WD10EAVS-00D