You are not logged in.

#1 2012-08-12 12:55:00

beopen
Member
Registered: 2012-06-29
Posts: 38

auto-detect & mount disk partitions and removable drives

I use ubuntu in addition to my current wip of installing arch linux.Now i have installed lxde desktop. But i am not able to see any of my partitions of my disk and other hdd. Besides removable drives also dont get mounted.
Similarly if a new partition is created the same also gets autodetected in ubuntu. eg my arch linux partition. I need not go to do any fiddling in the system to recognize the same.
So is it possible to achieve the same under archlinux?So want to know how to get  the same done.

what i want is to have the partitions[ext & ntfs] detected when the filemanager is opened and mount/unmount at my will, just as i do now in ubuntu.

So far what i have done is based on the lxde wiki, i installed the polkit-gnome gvfs package but nothing is mounted.
i would like to have specific instructions to how to work out and get the above  done.
pls guide to the same.

Last edited by beopen (2012-08-12 12:55:15)

Offline

#2 2012-08-12 13:00:22

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: auto-detect & mount disk partitions and removable drives

How do you start your xorg session? With a display manager like lxdm? startx? If you use startx, what does your ~/.xinitrc look like?

Offline

#3 2012-08-12 13:37:29

beopen
Member
Registered: 2012-06-29
Posts: 38

Re: auto-detect & mount disk partitions and removable drives

i use SLIM and my .xinitrc contains this line exec startlxde , besides the standard as you get from the skeleton.
I have not added anything else to the same.

Offline

#4 2012-08-12 13:58:02

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: auto-detect & mount disk partitions and removable drives

Slim uses the .xinitrc, right? In that case, you should not just have "exec startlxde", but "exec ck-launch-session startlxde" or  "exec dbus-launch startlxde" or even "exec ck-launch-session dbus-launch startlxde". I'm not entirely sure, re-read the wiki page!

Offline

#5 2012-08-12 14:34:44

projectdelphai
Member
Registered: 2012-05-17
Posts: 32

Re: auto-detect & mount disk partitions and removable drives

I have udiskie start at bootup in the .xinitrc with "udiskie &&". With that removable drives are mounted automatically at boot and when plugged in.

Offline

#6 2012-08-12 20:55:01

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: auto-detect & mount disk partitions and removable drives

Army wrote:

Slim uses the .xinitrc, right? In that case, you should not just have "exec startlxde", but "exec ck-launch-session startlxde" or  "exec dbus-launch startlxde" or even "exec ck-launch-session dbus-launch startlxde". I'm not entirely sure, re-read the wiki page!

I think the dbus-launch would be fine however do not add ck-launch-session. The latest Slim already takes care of ConsoleKit for you.

Offline

#7 2012-08-12 23:12:56

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,167

Re: auto-detect & mount disk partitions and removable drives

If you want other partitions to be mounted automatically, just add them to /etc/fstab. See the wiki page on fstab for details.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2012-08-13 07:48:00

beopen
Member
Registered: 2012-06-29
Posts: 38

Re: auto-detect & mount disk partitions and removable drives

anonymous_user wrote:
Army wrote:

Slim uses the .xinitrc, right? In that case, you should not just have "exec startlxde", but "exec ck-launch-session startlxde" or  "exec dbus-launch startlxde" or even "exec ck-launch-session dbus-launch startlxde". I'm not entirely sure, re-read the wiki page!

I think the dbus-launch would be fine however do not add ck-launch-session. The latest Slim already takes care of ConsoleKit for you.

but dbus is already launched as a daemon, and as said before slim already takes care of consolekit, hence i had just given exec startlxde in the xinitrc file.

further in the xinitrc wiki under the tips and tricks section there is a mention of bug FS#25031 where they ask the skeleton xinitrc to be modified to  start consolekit before dbus or your will have authorization problems when mounting drives.

Now thats a later part, here i cant see my drives at all in the file manager.

Now as far as that fstab is concerned i know that. My point here in asking was how to get the same done as i mentioned in ubuntu , where every partition [already created  &  if newly created] is shown automatically in the file manager there. click the partition and it gets mounted and viceversa. Becoz tomorrow if i create a new partition i will have to again edit fstab.
for eg this is the copy of my both fstab while typing this post

ubuntu fstab

# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
# / was on /dev/sdb6 during installation
UUID=e686af44-2486-416c-ba7a-1b811eaecd06 /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sdb2 during installation
UUID=f3b3c943-669e-464e-8e7b-220287e60d3d /boot           ext4    defaults        0       2
# /home was on /dev/sdb7 during installation
UUID=d7cba478-6f50-4032-ab77-50c0a58a92b1 /home           ext4    defaults        0       2
# swap was on /dev/sdb5 during installation
UUID=c09bec97-885c-42a0-b720-61618e2186b7 none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
 #  usbfs  /proc/bus/usb  defaults  defaults  0  0 

arch fstab

# <file system>	<dir>	<type>	<options>	<dump>	<pass>
tmpfs		/tmp	tmpfs	nodev,nosuid	0	0
/dev/sda5 / ext4 defaults 0 1
/dev/sda6 /home ext4 defaults 0 1
/dev/sda7 swap swap defaults 0 0

Now there  are two hdd on my system. even though ubuntu fstab above has no mention of sda , it is able to mount all of my sda drives. And you can see arch fstab is just showing 3 partitions of sda which is its own, whereas there is another ubuntu system running on sda an LVM. Similarly sdb has windows in addition to ubuntu and the ubuntu fstab above doesnt show two ntfs partitions. But as of now i can acess any of them at will with a mouse click.
And in the case of ubuntu i never till date have edited fstab or any other system file.
So my point here was how is this done automatically and i was looking for getting the same done on my arch system.

Offline

#9 2012-08-13 07:54:41

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: auto-detect & mount disk partitions and removable drives

If there is a bug about dbus being launched before consolekit, I presume you tried not using the skel and just making your own?

Maybe you should try backing up your existing .xinitrc and then creating a new one with simply "exec ck-launch-session dbus-launch startlxde" and then trying it with startx or xinit... see what happend then.


Edit: rather than going through all that crap, maybe just use xinit because it accepts arguments.  So something like

$ xinit /usr/bin/ck-launch-session /usr/bin/stratlxde

Last edited by WonderWoofy (2012-08-13 07:57:22)

Offline

#10 2012-08-13 10:02:07

ghost333
Member
Registered: 2011-11-26
Posts: 25

Re: auto-detect & mount disk partitions and removable drives

can  you post please the contents of
.xinitrc
/etc/slim.conf (only need the login_cmd  line)
/etc/rc.conf (need the daemons line)
?

here is how i have mine set up
rc.conf:

 DAEMONS=(syslog-ng  crond dbus  networkmanager sshd cpufreq slim )

slim.conf:

  login_cmd           exec /bin/bash -login ~/.xinitrc %session

xinitrc:

exec dbus-launch  openbox-session

replace openbox-session with  startlxde


also in order for all your partitions to get found u need to edit your /etc/fstab file.
if u want the system to find a newly created partition after you just created you will probably need to use some daemon, but in my opinion that is not a good logic , mainly because if u just created a new partition the first thing u want to do is format it , configured it and the check it. none can happen if it is already mounted.

Last edited by ghost333 (2012-08-13 10:06:37)

Offline

#11 2012-08-13 13:21:15

beopen
Member
Registered: 2012-06-29
Posts: 38

Re: auto-detect & mount disk partitions and removable drives

Slim conf: i did not modify this file so this line is as default

login_cmd           exec /bin/bash -login ~/.xinitrc %session

Daemons line in rc.conf:

DAEMONS=(hwclock syslog-ng network netfs crond dbus slim )

.Xinitrc: The same as copied from the skel and to it the only adjustment i make is the window manager or desktop session  which i want to start. For lxde as i said i was using the line

exec startlxde 

since i thought that dbus is there on my daemons line and the wiki said slim handles automatically consolekit.
Only for experimentation based on forum replies, i change the line to evaluate the new output. As of now my .xinitrc  goes this as below.

#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do

  [ -x "$f" ] && . "$f"

  done
  unset f
fi

# exec gnome-session
# exec startkde
# exec startxfce4
# ...or the Window Manager of your choice
#exec /usr/bin/jwm
#exec fluxbox
exec ck-launch-session startlxde

Offline

#12 2012-08-13 13:28:36

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: auto-detect & mount disk partitions and removable drives

Just FYI you can have DBUS started both as a daemon and as a user process.

Offline

#13 2012-08-13 15:39:03

ghost333
Member
Registered: 2011-11-26
Posts: 25

Re: auto-detect & mount disk partitions and removable drives

leave all as it is and just change the .xinitrc to have only this line inside:

exec dbus-launch  openbox-session

now lets try it

reboot
login
open your file manager(if u are using thunar u have to also install thunar-volman)
type this in a cosnole/terminal

udisks --monitor

plug in your USB disk.

did it work?
if no what events are recorded at the terminal above?

Offline

#14 2012-08-13 18:46:20

beopen
Member
Registered: 2012-06-29
Posts: 38

Re: auto-detect & mount disk partitions and removable drives

i did as you said. Now the openbox session gets launched instead of lxde and after typing in the console "udisks --monitor" ., i get this below message on the terminal:
"Monitoring activity from the disks daemon. Press ctrl + C to cancel "
After i plug in the usb nothing happens. My file manager is pcmanfm. Nothing gets mounted. So I press ctrl + C to cancel. Nothing new events got recorded on the terminal other than the above message.

Offline

#15 2012-08-13 19:37:40

ghost333
Member
Registered: 2011-11-26
Posts: 25

Re: auto-detect & mount disk partitions and removable drives

"exec startlxde   " was what i wanted to write but i made a mistake and copied my file contents ^_^ sorry.
but still udisks should have cathced the usb anyway.
so the problem perhaps comes form udisks
this might help https://wiki.archlinux.org/index.php/Udev#UDisks

Offline

#16 2012-08-14 12:24:12

beopen
Member
Registered: 2012-06-29
Posts: 38

Re: auto-detect & mount disk partitions and removable drives

this is a newly installed system. So what problem is coming from udisks ? can you pls clarify further i also wanted to know one more thing. what does this 'dbus-launch' means?
I removed dbus from daemons line and with your line in xinitrc, i found that after slim login lxde doesnt get loaded. Just a grey screen with a mouse cursor gets seen. So i again put back dbus in the daemons line.
As of now the status is same whether you put dbus-launch or just put startlxde in xinit.
The main query is still unanswered.
1. i want to see my partitions on the filemanager
2.Mount and unmount at will
3.Not edit fstab. [ the way it is done in readymade linuxes like ubuntu,fedora, or any live cds etc]
i am simply asking how to achieve the same.

Why pcmanfm is not displaying any partitions. whereas if you pass fdisk -l  on a terminal, everything is shown.
Next all this xinitrc fiddling has got to do what with display of partitions? it simply launches what u ask it to launch.
All my questions answer, if it is possible in arch linux like those readymade linuxes  is in 2 steps
1. get my partitions seen on the file manager
2. set them up to mount/unmount at will without an fstab editing.

Now unnecessary fiddling will lead to a corrupt system. Already as i told above, i have installed the polkit-gnome gvfs as mentioned in the lxde wiki hoping that the volumes will get mounted.But nope. Today i created some pkla files as mentioned in the udev and policy kit wiki.Yet nothing.
So basically i have no idea how to go about now honestly speaking. Except by constant fiddling i may perhaps dirty the system with no track of what i have done.So far i have gone serially from the beginers guide and from the base come upto an desktop system.
Now  only thing left of a major nature is this partitions visibility, mounting. Then the cosmetics are left.

Last edited by beopen (2012-08-15 06:09:55)

Offline

#17 2012-08-15 01:39:46

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,167

Re: auto-detect & mount disk partitions and removable drives

Please don't write things like "u" when you mean "you". From How to Post:

A sincere effort to use modest and proper language and grammar is a sign of respect toward the community that will certainly be appreciated and is quite likely to elicit positive responses. Please refrain from using so-called "textspeak", "netspeak", "leetspeak" and all other forms of internet slang.

What do you mean when you say that pcmanfm is not displaying *any* partitions? You see no files at all? Or do you mean: it is not showing partitions not listed in /etc/fstab?

When you say that in Ubuntu, newly created partitions show up automatically, do you mean that if you change the partitioning on your internal drive, the changes are automatically reflected in /etc/fstab?

Existing partitions will have been added to the Ubuntu fstab during the installation process. I believe genfstab does something like this on arch but I'm not sure as I haven't used it. Other than that, you need to edit fstab to include whatever partitions you want mounted.

If you mean that Ubuntu automatically adds, mounts and unmounts partitions on removable drives when e.g. a USB stick is inserted or when you change the partitioning on one and create a file system, that you can configure to work automatically in arch. There are details on the wiki - it partly depends on the DE you are using and partly on how you prefer to use it. I've never used lxde so I don't know for that case. udisks and one of the wrappers is probably what you need.

If you are worried about messing up your system, back it up first. You must expect to make mistakes - that's just part of learning new stuff.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#18 2012-08-15 12:50:35

beopen
Member
Registered: 2012-06-29
Posts: 38

Re: auto-detect & mount disk partitions and removable drives

cfr wrote :

What do you mean when you say that pcmanfm is not displaying *any* partitions? You see no files at all? Or do you mean: it is not showing partitions not listed in /etc/fstab?

I mean it is not showing partitions not listed in /etc/fstab. As of now pcmanfm shows only the arch systems partitions which I created while installation : root, and home. Balance of partitions of other systems of the same drive and second hard drive is not shown.

When you say that in Ubuntu, newly created partitions show up automatically, do you mean that if you change the partitioning on your internal drive, the changes are automatically reflected in /etc/fstab?

Yes the changes are automatically reflected in the filemanager of ubuntu, ie. Nautilius. However Ubuntu fstab as you see in the previous post of mine contains no entry to other partitions other than just ubuntus.In the fstab I posted above you can very well see it just shows 4 partitions of hdd1  [similar to the way the arch fstab shows only its own] where it is installed :boot,root,home, swap. Whereas there is two more partitions there viz windows and a ntfs. You don’t see them in fstab, but when you open the nautilius filemanager you can see the drives. See the image link of my filemanger posted below at the end. In that shared data and windows are two ntfs partition of hdd1 where ubuntu is installed. Arch is installed on 2nd hdd alongwith a Ubuntu.289gb partition is a ubuntu LVM along with arch root and arch home you can see.

If you mean that Ubuntu automatically adds, mounts and unmounts partitions on removable drives when e.g. a USB stick is inserted or when you change the partitioning on one and create a file system, that you can configure to work automatically in arch. 

Yes ubuntu automatically adds, mounts and unmounts partitions on internal drives and also removable drives when e.g. a USB stick is inserted  . As you can see in the image i have posted, it shows all my internal drive partitions automatically. No fstab editing nothing. No fiddling with system files so far i have done in ubuntu. For eg i installed arch a month back, the same you can see is automatically seen in the image. All i required was to   update grub  to recognise árch'. Post that when you boot, automatically the new arch partitions are seen. No fstab fiddling anything. Thus tomorrow morning if i create a new partition on my hdd via ubuntu all i require is to reboot post the creation and i will see the new partition asap.

As you can see in the image all my partitions are seen, the one i want i click it and it gets mounted, if i dont want it stays/gets unmounted. And its not just ubuntu i saw the same in some other distros also like suse,centos,fedora.

As far as the lxde wiki is concerned, there it is mentioned to install polkit gnome gvfs for mounting and i did the same but nothing still happens.

So this is what exactly i am asking how to do the same on my arch system. So if i am guided i wil go ahead and work to achieve the same.

image link of file manager : NautiliusFileManager

Last edited by beopen (2012-08-15 13:00:26)

Offline

#19 2012-08-15 16:09:18

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: auto-detect & mount disk partitions and removable drives

Hi beopen, can you use quote tags instead of code tags when quoting people. Code tags should be used for terminal output and actual code. If you need help with BBCode feel free to ask (in a new thread). Thanks.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#20 2012-08-15 17:26:38

Lennie
Member
From: Sweden
Registered: 2011-10-12
Posts: 146

Re: auto-detect & mount disk partitions and removable drives

What is the output of

ps x | grep gvfs

Offline

#21 2012-08-15 21:50:41

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,167

Re: auto-detect & mount disk partitions and removable drives

As far as the lxde wiki is concerned, there it is mentioned to install polkit gnome gvfs for mounting and i did the same but nothing still happens.

It also says to configure them. Did you do that?

In your arch fstab, only / should be "0 1". Any other partition you want checked (such as /home), should be "0 2".

Since you say it is necessary to reboot for Ubuntu to recognise new partitions on internal disks, I suspect that whatever Ubuntu is doing is going to be a function of its management of the boot process. I can't remember what Ubuntu uses - upstart? - but I'm sure it isn't initscripts.

You might be able to do what you want with systemd. I can't tell from the wiki one way or another but it has a lot more features than traditional initscripts.

Note that this doesn't apply to automatically mounting removable disks etc. e.g. usb drives, keys, flash media etc. That you can certainly get to work with initscripts by using udisks etc.

Last edited by cfr (2012-08-15 22:28:47)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#22 2012-08-16 03:49:34

beopen
Member
Registered: 2012-06-29
Posts: 38

Re: auto-detect & mount disk partitions and removable drives

the output is this

  ps x | grep gvfs
  568 ?        S      0:00 /usr/lib/gvfs/gvfsd
  570 ?        Sl     0:00 /usr/lib/gvfs//gvfs-fuse-daemon -f /home/cow/.gvfs
  584 ?        S      0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
  680 pts/0    S+     0:00 grep gvfs

Offline

#23 2012-08-16 06:06:47

beopen
Member
Registered: 2012-06-29
Posts: 38

Re: auto-detect & mount disk partitions and removable drives

@cfr:
yes i did configure to what extent it is said in the wiki viz created the autostart directory and copied the polkit gnome authentication agent-1 desktop file.Only in the current file this line OnlyShowIn=GNOME;XFCE; is not there to modify
As far as fstab of arch is concerned , i have not edited it. It is what is as created by the system and i pasted the contents on the forum post. And when i log into arch, the filemanager shows the two partitions root and home just like any other linux system shows. So no problems with seeing or partitions of arch system.The problem is only of seeing the partitions of other system . The fstab wiki says this

"<pass> - used by fsck to decide which order filesystems are to be checked. Possible entries are 0, 1 and 2. The root file system should have the highest priority 1 - all other file systems you want to have checked should have a 2. File systems with a value 0 will not be checked by the fsck utility.

.Thus as you say So do you want me to change it to 0 2 from the current 0 1  which is being shown or leave the same as default created by the system.
Further a correction to my statement of need to reboot ubuntu to recognize new partitions. There is no need to reboot , the partition is created on the fly and immediately available for use right in the session itself. It is similar to diskmanagement in windows xp/nt. I just messed up in my mind while typing the post, the installation scene with the one of the  session , a memory lapse. So pls ignore my earlier statement. So for eg today right in the session i created a new temp partition and immediately it got shown on the filemanager and i also saved a file on that partition. No reboot.

Then i mounted the new partition i created today  with a new fstab entry under media folder with this entry below in arch linux for an experiment.
/dev/sda4 /media/delvol ext4 defaults 0 2
This is ofcourse for temp purposes.
it gets mounted and all fine and gets seen in pcmanfm not directly like of my Ubuntu screenshot, but you have to go to '/ 'then 'media' and in that in the relevant folder here 'delvol'. But its visibility is not comfortable like the ubuntu screenshots i posted, where you see your partitions seperately like distinct entities when you open the filemanager. Almost similar like  C: D: of windows.

So i would definitely like to have the filemanager in arch also load things the same way as i mentioned in the screenshot.

Offline

#24 2012-08-16 12:19:39

Lennie
Member
From: Sweden
Registered: 2011-10-12
Posts: 146

Re: auto-detect & mount disk partitions and removable drives

I think this problem is caused by Slim, as your other problem. What I told you there should be a good start to solve this also.

* Get rid of Slim, and use startx from console until your problems are solved.
* Make sure you have dbus in your DAEMONS array in rc.conf.
* Your .xinitrc should only have this line:

exec ck-launch-session dbus-launch startlxde

It's strange the other partition doesn't show up in PCManFM. The normal behavior is that they show up but you are not allowed to mount them. Gvfs seems to be running.

Offline

#25 2012-08-17 01:16:50

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,167

Re: auto-detect & mount disk partitions and removable drives

beopen wrote:

As far as fstab of arch is concerned , i have not edited it.

This is arch. Editing fstab is part of configuring your system. genfstab will give you a basis but it is up to you to configure it as you wish. The wiki page on fstab explains the various options. (Or the manual page.)

Thus as you say So do you want me to change it to 0 2 from the current 0 1  which is being shown or leave the same as default created by the system.

I don't *want* you to do either. It is your system and your choice. I was simply pointing out the way it should be done according to the documentation. What you do with that information is entirely up to you smile.

I'm afraid the analogy with windows doesn't help me much though I expect others will know what you mean. The last version of windows I used at all regularly was windows 95 which I stopped using in 2001. If you've got a Mac analogy I might get it if it isn't too recent a version.

Have you tried dropping slim, as suggested?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB