LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-22-2012, 08:14 AM   #1
alek66
Member
 
Registered: Apr 2004
Location: Argentina
Distribution: netBSD/Linux
Posts: 256

Rep: Reputation: 30
How to run apps as services and FSTAB questions


I installed Lubuntu (a lightweight variant of ubuntu) on my new homerserver:

Services:
I would like to get vino(remote desktop server), transmission, and ps3media server to run as services (basically so I can monitor them via Ajenti (where I can see if the services are running, and stop/start/restart them))

Also to get the to start at boot time. I googled it, but could find a specific way to achieve this.

FSTAB:
I have 3 (hard, non remomable) disks on the BOX:
-Mounted File Systems-
/dev/sda1 / 32.59 % (73.9 GiB of 109.6 GiB)
/dev/sdc1 /media/TimeMachine 60.94 % (29.1 GiB of 74.4 GiB)
/dev/sdb1 /media/160 6.56 % (139.1 GiB of 148.8 GiB)

SDA1 is the disk where the OS is installed.
The other two, one is for time machine, the other as a general use. This two, are only mounted if I click on them on the GUI, I saw also they are not on the fstab:

Quote:
# /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>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=5e94c099-d34f-45fc-b9dc-6f859dabc626 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=7f602713-1a85-4599-9767-c645ed77e978 none swap sw 0 0
I want those two disk to be mounted at boot time, automatically, Why don't they appear in the fstab? and appear as a "click n mount" drive?

Both other disk are ext4 and where at the installation.
 
Old 08-22-2012, 09:26 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,213

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Quote:
I want those two disk to be mounted at boot time, automatically, Why don't they appear in the fstab?
Were those drives in the machine when you installed? If not, you have to manually add them. That is normal operation.

If there were there, I have no idea why they were not picked up by the install. Add them now. You cnd find the uuid's for each partition in /dev/disk/by-uuid/ . Hope this helps.
 
Old 08-22-2012, 09:28 AM   #3
alek66
Member
 
Registered: Apr 2004
Location: Argentina
Distribution: netBSD/Linux
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by camorri View Post
Were those drives in the machine when you installed? If not, you have to manually add them. That is normal operation.

If there were there, I have no idea why they were not picked up by the install. Add them now. You cnd find the uuid's for each partition in /dev/disk/by-uuid/ . Hope this helps.
Cliff; thanks, yes, noth disk were at installation. Once I get the uuids what do I do, I dont want to mess up anything, If I add them to the fstab, will they still appear as "click n mount" drives?
I wont get duplicated entries?
thanks
 
Old 08-22-2012, 10:50 AM   #4
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,213

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
The very first thing you do is make a backup copy of fstab. You need to be root to do so, on buntu's you prefix the commands with 'sudo command' and you will be asked for the root password. You enter the password and the system will execute the command.

To make a backup copy of fstab, the command 'sudo cp /etc/fstab /etc/fstab.back' will do it. Enter everything except the quotes, just what is between them. I'll show you quotes, so you do not add extra stuff to the commands. This command will create a new file called fstab.back in the /etc directory.

Next, look up the uuid's. I like the copy and paste them to avoid typos. If you make a typo error, the partition will not mount.

The easy way is to use a plain text editor for this task. All distros ship with vi, however for anyone with little experience, this is a challenge. See if you have nano or pico. In a konsole, try 'sudo nano /etc/fstab'. If the file opens, you are good to go. If not, ( you get a command not found ) substitute pico in place of nano. gedit is another one that might be there. Once you have the file opened with sudo; then you can add a line for each partition you want mounted.

From what you posted above, you have one line that looks like this:

Quote:
UUID=5e94c099-d34f-45fc-b9dc-6f859dabc626 / ext4 errors=remount-ro 0 1
Copy this line, and paste it below the last line of the file. Now edit the uuid field to match the first uuid ( partition ) you need to mount. The ext4 is the file system type. I would guess you formatted the drives as ext4. If not, then change this field to match the FS type. The rest, you can leave as is. This will give you system defaults, with "on errors" ( disk errors ) mount read only. They will mount read write on system default.

Once you have added a line for each partition, then it is time to test. As root user, issue a mount command. 'sudo mount'. The system will mount ad partitions not mounted. Use a file manager to see if you can see the partitions. If yes, you are good. Boot the system, and verify that all partitions are mounted.

If something doesn't mount check what you have done. Spacing matters, so look at what was there before you messed with the file, look for typing errors, or uuid errors.
 
Old 08-22-2012, 11:00 AM   #5
alek66
Member
 
Registered: Apr 2004
Location: Argentina
Distribution: netBSD/Linux
Posts: 256

Original Poster
Rep: Reputation: 30
Wink

Quote:
Originally Posted by camorri View Post
The very first thing you do is make a backup copy of fstab. You need to be root to do so, on buntu's you prefix the commands with 'sudo command' and you will be asked for the root password. You enter the password and the system will execute the command.

To make a backup copy of fstab, the command 'sudo cp /etc/fstab /etc/fstab.back' will do it. Enter everything except the quotes, just what is between them. I'll show you quotes, so you do not add extra stuff to the commands. This command will create a new file called fstab.back in the /etc directory.

Next, look up the uuid's. I like the copy and paste them to avoid typos. If you make a typo error, the partition will not mount.

The easy way is to use a plain text editor for this task. All distros ship with vi, however for anyone with little experience, this is a challenge. See if you have nano or pico. In a konsole, try 'sudo nano /etc/fstab'. If the file opens, you are good to go. If not, ( you get a command not found ) substitute pico in place of nano. gedit is another one that might be there. Once you have the file opened with sudo; then you can add a line for each partition you want mounted.

From what you posted above, you have one line that looks like this:



Copy this line, and paste it below the last line of the file. Now edit the uuid field to match the first uuid ( partition ) you need to mount. The ext4 is the file system type. I would guess you formatted the drives as ext4. If not, then change this field to match the FS type. The rest, you can leave as is. This will give you system defaults, with "on errors" ( disk errors ) mount read only. They will mount read write on system default.

Once you have added a line for each partition, then it is time to test. As root user, issue a mount command. 'sudo mount'. The system will mount ad partitions not mounted. Use a file manager to see if you can see the partitions. If yes, you are good. Boot the system, and verify that all partitions are mounted.

If something doesn't mount check what you have done. Spacing matters, so look at what was there before you messed with the file, look for typing errors, or uuid errors.
Cliff: Thanks for all this instructions. I knew how to edit, and that I needed to be root. But it never hurts to repeat. I undertood everything perfectly, I just need to know one thing that might be basic....

Wheres the mount point for those new disks?
 
Old 08-22-2012, 11:06 AM   #6
414N
Member
 
Registered: Sep 2011
Location: Italy
Distribution: Slackware
Posts: 647

Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by camorri View Post
Copy this line, and paste it below the last line of the file. Now edit the uuid field to match the first uuid ( partition ) you need to mount. The ext4 is the file system type. I would guess you formatted the drives as ext4. If not, then change this field to match the FS type. The rest, you can leave as is. This will give you system defaults, with "on errors" ( disk errors ) mount read only. They will mount read write on system default.
You forgot to mention that the mount point ("/" in your example) needs to be changed too.
If the directory you want to specify as mount point doesn't exist, simply create one with mkdir.
 
Old 08-22-2012, 11:09 AM   #7
alek66
Member
 
Registered: Apr 2004
Location: Argentina
Distribution: netBSD/Linux
Posts: 256

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by 414N View Post
You forgot to mention that the mount point ("/" in your example) needs to be changed too.
If the directory you want to specify as mount point doesn't exist, simply create one with mkdir.
thanks man!!! will try it in a few hours, let ya know in a while.
 
Old 08-22-2012, 11:09 AM   #8
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,213

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
Quote:
Wheres the mount point for those new disks?
Where ever you want.

As a suggestion, I create a empty directory in /mnt such as /mnt/sdb1 and mount sdb1 there. It makes it easy for me to remember.

Things to consider, is this system used by other users? If not, mount them where you want. You can mount them inside your home directory if you want. I wouldn't do that if you have other users accessing the drives though.
 
  


Reply

Tags
fstab, lubuntu, services


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
[SOLVED] maximal mount count reached - how can I fix fstab to run e2fsck or run it manually? jg1 Linux - Newbie 4 08-06-2011 06:09 PM
LXer: Using Mozilla Prism to Run Web Apps like Local Apps on Linux LXer Syndicated Linux News 0 03-24-2010 02:10 PM
For Services, Apps, and Daemon, it should be OBLIGED to provide EASY configurater!! frenchn00b Debian 5 09-10-2009 10:23 PM
How to launch apps on start up? automatically? (Just like startup services in windos) wrapster Solaris / OpenSolaris 3 07-24-2009 03:28 PM
Remove useless services / apps BeaverusIV Linux - General 6 08-22-2005 08:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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