LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-11-2017, 01:49 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Mount USB flash drive earlier in boot process - systemd adjustment?


I have a Dell Latitude 2100 mini-laptop (Ubuntu Mate 16.04) re-purposed to serve as a jukebox for my workshop. My 400+ albums converted to .mp3 on the SSD and a next-to-no privileges account which executed an auto logon at boot time. Caja (Nautilue) and audacity (music player) are set as startup programs for the auto logon account. Works great. I boot it up and the music play picks up from where it was when I shut the computer down (or suspended it if I will only be a way for a short time.)

Recently I acquired some additional mp3 files. I had them on a USB flash drive. I plugged in the drive and copied a selection of tracks to the audacity playlist. They played just fine. I then shut down the PC for the evening. Next day when I booted the machine back up I noticed, in a LARGE dialog, that the files on the flash drive which were listed in audacity were not available. I cleared the dialog and resumed playing the listed tracks in audacity.

It appears that audacity started BEFORE the USB flash drive had mounted. This leads me to the question... Is it possible to cause the USB drive to mount earlier in the boot process - before the auto logon perhaps? I suspect this could be done through systemd but while I have come concept of how systemd works, I have never actually made any adjustments to the boot process. Any advice?

TIA,

Ken

p.s. While composing this post and thinking about the situation... I suspect it might be a problem if the boot process mounted the flash drive rather than the user. If I plug in a USB drive it mounts at /run/media/username. If it is mounted by the boot process (as root?) I might have to address permissions. A little more complex that plug-and-play but still worth a try.
 
Old 08-11-2017, 02:26 PM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Personally, I'd go for a much simpler solution - instead of running audacity, run a dumb little script that looks something like this:

Code:
#!/bin/sh

sleep 15
audacity
Set that script to autostart instead of audacity itself. It will wait 15 seconds and then run audacity. That should be plenty of time for the USB drive to automount (what is mounting it? I guess not /etc/fstab, because that would mount really early on...but I guess it's something the GUI desktop environment is set to do or something).

You can, of course, experiment with how much of a time delay is good enough.
 
1 members found this post helpful.
Old 08-11-2017, 02:57 PM   #3
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Thank you IsaacKuo !!!

That is in keeping with my normal pick and shovel (or BFH) approach to fixing problems It sort of reminds me of a script I used on my Osborn (CP/M) computer to start Wordstar. Instead of actually starting Wordstar ws<Enter> would execute the script which would:

Start Wordstar (which was patched to look on the B diskette for data files)
Upon exiting from Wordstar it would prompt me to put my backup diskette in the A drive
Use PIP (peripheral interchange program) to backup any new or changed files from the data diskette in B to the backup diskette in A

The music file question is not really critical. I AM looking for little tasks to start building my knowledge and skills in managing systemd. The task I really want to accomplish is to configure my servers to conditionally unlock and mount encrypted file systems IF and ONLY IF a certain USB drive is present and contains the appropriate key file(s). Currently is use /etc/crypttab and /etc/fstab. If the key file is not available the server will not boot. I have a script roughed out to do the conditional unlock/mount but I have no idea how and where to shove it into the systemd universe.

Ken
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] unable to mount a usb flash drive and an SD card after changing mount directory name remn Linux - Newbie 24 10-24-2015 03:04 PM
USB Flash drive mount at boot time logeait Linux - Embedded & Single-board computer 4 08-03-2008 02:12 AM
Mount USB sooner / earlier in boot process int0x80 Debian 1 10-17-2006 04:43 AM
when i mount my USB Flash Drive A Messenge has come that mount: can't find /dev/sda/h feda82 Red Hat 2 12-24-2005 07:16 AM
when i mount my USB Flash Drive A Messenge has come that mount: can't find /dev/sda/h feda82 Red Hat 2 12-24-2005 02:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:20 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
Open Source Consulting | Domain Registration