LinuxQuestions.org
Help answer threads with 0 replies.
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 05-12-2014, 07:02 AM   #1
Tassadar
LQ Newbie
 
Registered: Jul 2013
Posts: 27

Rep: Reputation: Disabled
Question How to auto-recognize drive units on boot?


Hi all, I have a problem with my HTPC based on Kubuntu.

I have an SSD for the OS and a 2tb drive for files. Everytimes I boot the computer I have to go to Dolphin file manager and enter on the secondary drive that appears as a device; this is because it appears with a red croos icon, and when I enter on it it changes to a green ok icon.

If I enter XBMC without having done this, I can't access to the content of this drive, so I always have to enter dolphin and open drive before opening XBMC.

It's very annoying, so... how can I make kubuntu enable this drive automatically on every startup? It also happend if a use a USB hard drive, by default I cant access to it until I open in dolphin.

I want Linux to automount? (not sure if it's the appropiate word) all units on start and show them with green ok icon instead red cross.

Many thanks in advance
 
Old 05-12-2014, 07:42 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
hi, while you are able to browse the files on the drive can you please copy-paste the output of these commands:
Code:
df -h
cat /etc/fstab
 
Old 05-12-2014, 09:13 AM   #3
Tassadar
LQ Newbie
 
Registered: Jul 2013
Posts: 27

Original Poster
Rep: Reputation: Disabled
Many thanks for your interest and help, schneidz

In this PC I only the system disk, but there is an USB drive connected and the behavior is exactly the same.

Before double click the unit on Dolphin:

Quote:
elhtpc@elhtpc:/usr/share/xbmc/addons$ df -h
S.ficheros Tamaņo Usados Disp Uso% Montado en
/dev/sda1 107G 27G 75G 27% /
none 4,0K 0 4,0K 0% /sys/fs/cgroup
udev 1,8G 8,0K 1,8G 1% /dev
tmpfs 366M 1,4M 365M 1% /run
none 5,0M 0 5,0M 0% /run/lock
none 1,8G 144K 1,8G 1% /run/shm
none 100M 20K 100M 1% /run/user

elhtpc@elhtpc:/usr/share/xbmc/addons$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=928a3979-d26c-4d5a-96bc-7106314f545c / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=cde2c09c-0769-4bda-86aa-7ece8083e1b0 none swap sw 0 0
elhtpc@elhtpc:/usr/share/xbmc/addons$
Afer double click and access drive:

Quote:
elhtpc@elhtpc:~$ df -h
S.ficheros Tamaņo Usados Disp Uso% Montado en
/dev/sda1 107G 27G 75G 27% /
none 4,0K 0 4,0K 0% /sys/fs/cgroup
udev 1,8G 8,0K 1,8G 1% /dev
tmpfs 366M 1,4M 365M 1% /run
none 5,0M 0 5,0M 0% /run/lock
none 1,8G 144K 1,8G 1% /run/shm
none 100M 20K 100M 1% /run/user
/dev/sdb1 7,6G 6,5G 1,1G 86% /media/elhtpc/PENDRIVE

elhtpc@elhtpc:~$ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda1 during installation
UUID=928a3979-d26c-4d5a-96bc-7106314f545c / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=cde2c09c-0769-4bda-86aa-7ece8083e1b0 none swap sw 0 0
elhtpc@elhtpc:~$
Many thanks
 
Old 05-12-2014, 09:36 AM   #4
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
i would add something like this to the last line of /etc/fstab
Code:
/dev/sdb1 /media/elhtpc/PENDRIVE ext4 errors=remount-ro 0 0
can you please show me the output of the mount command while you are able to access the usb drive.

also, if anyone else knows how to get the uuid of drives that would probably be the preferred way of mounting things via /etc/fstab.
 
Old 05-12-2014, 11:46 AM   #5
spazticclown
Member
 
Registered: Sep 2010
Distribution: Fedora, Android, CentOS
Posts: 91
Blog Entries: 2

Rep: Reputation: 21
Quote:
Originally Posted by schneidz View Post
also, if anyone else knows how to get the uuid of drives that would probably be the preferred way of mounting things via /etc/fstab.
Code:
ls -l /dev/disk/by-uuid/
Should do the trick.

Code:
ls -l /dev/disk/by-uuid/ | grep -i "/dev/sdb1" | awk '{print $9}'
Will print off the UUID of /dev/sdb1.
 
1 members found this post helpful.
Old 05-12-2014, 12:42 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,669

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
The blkid utility will also display information for filesystems by device ID, UUID and label.
 
Old 05-12-2014, 01:18 PM   #7
Tassadar
LQ Newbie
 
Registered: Jul 2013
Posts: 27

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by spazticclown View Post
Code:
ls -l /dev/disk/by-uuid/
Should do the trick.

Code:
ls -l /dev/disk/by-uuid/ | grep -i "/dev/sdb1" | awk '{print $9}'
Will print off the UUID of /dev/sdb1.
Many Thanks,

I will do it for using samba locations since I see it's useful for this, by now I solved this problem in this way:

see systemsettings -> removable devices -> attached drives

for all removable drives:
1) -> enable automatic mounting .........., click preferences
or for only that 1 drive:
2) -> select the usb driv -> click automount on login & automount on attach

Honestly, I really really can't figure out why this option is not enabled by default, many times it looks like Linux is made to be as difficult as possible instead of easy.

Regards
 
  


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
how do I auto-mount a drive at boot warkrime Linux - Newbie 7 08-03-2013 04:56 AM
Can't install ubuntu, won't recognize partition & auto option too small. cayennep Linux - Newbie 1 09-01-2009 02:36 PM
Live CD that recognize raid units Snouser Linux - Newbie 1 11-06-2006 08:55 PM
auto mount a network drive at boot Dr Gutiemouth Linux - Newbie 14 02-27-2005 01:32 PM
I can see shared units on Windows boxes, but can't see any files within these units emiliofil Linux - Networking 2 01-24-2005 08:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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