Debian Installation :: Systemd - Automount Windows Partition / USB Devices In Jessie
May 11, 2015
There seems to be no documentation on how to automount partitions and USB devices under systemd in Jessie. (Overall, systemd entirely lacks any useful documentation or GUI configuration tools -- all very cryptic and hidden.)
I created custom files to enable automounting. I put them in /etc/systemd/system -- this may not be the right place, but it works.
Kernel note:
This does not work under the old Wheezy kernel linux-image-3.2.0-4.
To automount my Windows partition so I can access its files, I created:
/etc/systemd/system/media-windows.mount
The name of the file must match the mount point -- in this case, /media/windows
My file notes the device and file type, plus an fmask option so all the Windows files don't seem to be executable:
[Unit]
Description = windows mount to /media/windows
[Mount]
What=/dev/sda1
Where=/media/windows
Type=ntfs-3g
Options=fmask=111
[Install]
WantedBy=multi-user.target
The file ownership must be root.root. Apparently it doesn't need to be executable.
After creating, enable with:
sudo systemctl enable media-windows.mount
and it will mount on the next boot.
I read elsewhere that the before running the enable command you should run a start command:
I have done on previous releases, but this time it hangs on me. It's "only" a Virtualbox, so I can reproduce it.
The wheezy already runs systemd, and is fully updated to to latest packages. Does not run any graphical.
Edits the source.list and does $ apt-get update $ apt-get upgrade # Did on one upgrade $ apt-get dist-upgrade
It starts to upgrade (complains about missing version in libpgp-error), libc is installed, but at some point the systemd is running at high CPU and a dpkg seems to be stalled.
Should I disable systemd on wheezy before? This might not have been tested so much.
Fixing my chronic suspend/resume problems turned out to be easier under systemd, but like everything else lacks documentation.
To suspend rather than power off when pressing the power button, I edited /etc/systemd/login.conf
uncommenting this line and changing it to suspend: HandlePowerKey=suspend
and uncommenting the line HandleLidSwitch=suspend
Some services were lost on resume. This problem seems common. To run a command on resume, I believe you have to make your own script, and create a systemd file to run it.
My script is /home/james/.bin/james-resume.service, which contains:
#! /bin/sh /sbin/hdparm -B 255 /dev/sda
This must be executable. Ownership doesn't seem to matter.
To run it, I made a file in /etc/systemd/systen/suspend.target.wants The file name must match the script name: /etc/systemd/system/suspend.target.wants/james-resume.service
This contains:
[Unit] Description=Run James jobs at resume After=suspend.target After=hibernate.target After=hybrid-sleep.target
Previously it was only trying to mount the partition (after asking for the root password) in /media/datas
Is it normal that now it tries to mount it only for my current user in another folder?
If I look in the /var/log/messages, I only see this:
May 22 23:53:06 Tieum-Latitude gnome-session[2092]: Thunar: Failed to open "/media/mb/datas": Error when getting information for file '/media/mb/datas': Input/output error
as far as I can see, there is currently no option to delete this files from within systemd facilities, is that correct?
Should they be deleted manually, or just left alone?
Apparently I can still read all older logs regardless of such reported corruption, using the journalctl --boot -n option.
EDIT:Another thing coming to mind is that this has been happening for me not only in Jessie but in every systemd-based distro that I've tried, once permanent logging is enabled: is that some kind of systemd bug?
I'm using Debian Squeeze XFCE along with Windows 7 as dual boot on my notebook. I want to access my Windows 7 partitions from Debian for both reading and writing. I was a Ubuntu user in which the Windows partitions were visible by default. I want to know how to mount the drives used by Windows 7 automatically on startup.
I don't have an opportunity to check it out now... Does Debian 6 testing mount inserted CDs/Flash-drives automatically like Ubuntu does? Or the only way to mount them after inserting is to use mount command?
I'm running KDE in Jessie and also have Gnome installed. When I connect a usb drive it gets mounted at /media/username/disklabel. I would like to have it mounted at /media/disklabel which is how it worked in Wheezy. How can I make that change?
When a USB device is attached to the laptop 10.04 does not automount the device. i.e. the device, be at an external drive, memory stick or iPod does not display with the correct icon on the desktop.
However, if one looks under Places|Computer there they all are with the correct icons. The devices can then be mounted from there.
This issue seems to be related to these other posts: [URL]
This is really disappointing given that 10.04 was promoted on its iPod friendliness!
System: IBM Thinkpad T41; Pentium-M 1.6GHz; 1Gb RAM
I have an issue with Gparted v0.19.0 (Jessie) which has replaced v0.12.1 (Wheezy) which works fine. I had hoped to ask this question in Gparted's own forum, but after three weeks and multiple attempts no-one has approved my account there.
Unfortunately, my existing partition structure (on two different laptops) seems to be invisible to the new version of Gparted. Since parted seems to be used by the Debian installer, the Jessie installer cannot install on these machines without repartitioning the entire disk. That means that on such machines, the only option is to wipe everything or install Wheezy, then edit sources.list to upgrade to Jessie.
Both Gparted v0.19.0 and the Jessie installer report the entire hard disk as a single Fat16 partition,The same partitions which are invisible to Gparted appear as normal in the Places sidebar, of either Thunar or the PCManFM file manager. They can be mounted and used, seemingly without issue (I have experienced the same problem under Ubuntu/Lubuntu 15.10). Below, is the shell output of fdisk, which can see the partition structure and parted, which cannot:
I have a Dell laptop (inspiron 1150) which was dual booting Windows XP and Ubuntu 9.04. I have successfully installed Debian Jessie Standard over the Ubuntu. I pre-partitioned using gparted-live to make a separate single partition for the Debian install. Guided partitioning was then carried out by the installer producing separate /, /home, and swap partitions. After installation, the grub menu shows an entry for Debian and Windows XP. I can boot Debian, but not Windows XP. The symptoms are the same as reported in other forums: A terminal is displayed, vanishes and the system reboots defaulting to the Debian boot.
The grub.cfg file for the Jessie system has an other-os entry:
Code: Select allmenuentry "Microsoft Windows XP Home Edition (on /dev/sda2)" { set root=(hostdisk//dev/sda, msdos2) search --no-floppy --fs-uuid --set=root cc0ce0ab0ce091ae drivemap -s (hd0) ${root} chainloader +1 }
The original Windows entry for the Ubuntu install was:
Code: Select allmenuentry "Microsoft Windows XP Home Edition (on /dev/sda2)" { insmod ntfs set root=(hd0,2) search --no-floppy --fs-uuid --set cc0ce0ab0ce091ae drivemap -s (hd0) ${root} chainloader +1 }
The partitions produced by partman look OK (during the pre-partitioning I did not touch sda1, sda2, or sda3):
Code: Select all~ # os-prober /dev/sda2:Microsoft Windows XP Home Edition:Windows:chain
So it seems that everything is in place, but there are perhaps important differences in the grub.cfg files. Are the two "set root" commands equivalent for example?
I installed Storage Device Manager and can't automount my Windows 7 partition. It doesn't show up in Storage Device Manager. When I mount the partition, it comes up as /media/286CC2A6397A0F2A instead of sda# like normal drives.
After a new Fedora 12 installation, i cannot automount my Windows partition. My system is setup originally at windows XP ,partitioned, then change to Fedora 10. Change to Fedora 11 through update.System very slow.
I decided to upgrade to fedora 12 by DVD installer, then i have to mount manually to access my back-up, when typing su -c '/sbin/fdisk -l' at terminal, this is the code:
I am having issues with Grub 2 after installing Debian 7.8.0.The computer is a HP Pavilion 500-307nb. I made the original harddrive /dev/sdb and inserted a Samsung Evo 840 as /dev/sda. From the original hard drive (/dev/sdb), I wiped the windows partition, but left all other partitions unchanged (in case I would ever want to recover the desktop to its original state). I replaced the wiped windows partition with a swap partition and an LVM partition.These are my hard drive partitions:
/dev/sda (Samsung Evo 840)
Number Start End Size File system Name Flags 1 1049kB 3146kB 2097kB primary bios_grub 2 3146kB 944MB 941MB ext4 boot 3 944MB 94.4GB 93.4GB host lvm 4 94.4GB 1000GB 906GB guests lvm
[code]....
The partition /dev/sda3 has 2 logical volumes with filesystem ext4 that I mount to / and /home.The partition /dev/sda2 is mounted to /boot..When I install like this, Debian installs fine, however Grub2 is not installed correctly.Debian installs grub-pc which seems not able to boot the gpt partition. So I boot the Debian CD in rescue mode and execute:
mount /dev/sda2 /boot aptitude purge grub-pc aptitude -y install grub-efi
After rebooting, I come in the grub rescue shell, which says: error: no such device: 986f2176--4a4b-4222-83b9-8636a034b3c7.
When I then enter in the grub rescue shell: set boot=(hd0,gpt2) set prefix=(hd0,gpt2)/grub insmod normal normal
Grub and Debian start up correctly.why can Grub not start up automatically correctly? Where does the UUID 986f2176--4a4b-4222-83b9-8636a034b3c7 come from? I have reinstalled Grub several times, I have reinstall Debian several times, I have even wiped all partitions from /dev/sda and recreated a new gpt table with parted and manually set the partitions in parted. Still on each reinstallation, Grub fails because it cannot find exactly the same UUID. Since this UUID is always the same, it must be stored somewhere, but it cannot be the partitions, I have wiped them and the partition table several times.
I did though a firmware update of the Samsung Evo 840 before reinstallation, could this be a cause?Also the problem is not in grub.cfg. Grub starts correctly if I enter the commands above in the grub rescue screen and the UUID value does not appear there.
I managed with fstab but at restart came a black screen.I have called an HD '7200' then I reinstalled Fedora. And it does not automount it anymore. I changed fstab and black screen.
i use a 3rd party boot mgr.i installed jessie over etch on my old computer & only choice i saw for grub was sda & sdb where i wanted to install on sdb9.i tried installing it from my wheezy partition & it did but i ended up with 2 boots to wheezy.so i went back to etch.
my question is how to get grub on sdb9 like it was on etch.is there a trick or did i miss a prompt? on another note, that bug where the format hangs if you try & install over an old system is a little irritating. can't believe it hasn't been fixed.
Since I created second user USB devices as PTP camera, flash mass storage automounts always for the new user. Even the second user is not logged in automount does not work for main user. When I log in as second user (with device plugged in) it is mounted automatically after log in.
What can I do with this problem? I would like to access devices from each user (not necessarily at the same time). How can I configure it? How can I "remount" device to my current user without switching into the second one (it's someones else account)?
I believe this has something to do with an mdadm update which was included in the release. When I configured the array, I didn't partition the disk devices, so maybe that has something to do with it. I am thinking of rebuilding the array and partitioning prior to build, but a quick fix would be referable.
And also something appears to have happened to the raid device since the update.
Prior to update, the array was /dev/md0 - now it is /dev/md/0 which is a symbolic link back to /dev/md0.
mdadm --detail --scan now reports /dev/md/0 where previously it reported /dev/md0
I created a new RAID1 array on a fresh system and immediately after the create, these messages appear at 5 minute intervals.
My hard drive is partitioned fairly simply, with two primary partitions, one for Windows and one for Debian Squeeze.How can I remove sda1 and make it so that Debian takes up the whole disk on one large partition without reinstalling?I have downloaded and burnt the gparted live cd, but I daren't go any further without some hand holding.
I am looking for info about how works automount process, and i didn't find info about the tollowing ...
I wonder ... how can i do to "config" automount process to put all my usb devices in write-back mode as default ... for example ... what file can i change? ... how to do it ?
And another one ... um... how to say to "automount process" ... to put my usb devices into a "deadline" io scheduler .. for example ... how to set io-scheduler for an automount device ?
I have set up authentication when I am logging from my laptop using windows 7 (putty) into Debian server (see this post [URL].....) but since my laptop is dual boot (Windows 7 and Ubuntu) how would I set up authentication when i am using Ubuntu since from Ubuntu I will be logging into Debian SSH as same user that I am when logging from windows?
I recently installed GNOME on my debian machine. I want to try using that as a second monitor for my windows 8 computer. I can't seem to find instructions on google, I want to try doing this wirelessy; is there freeware that lets me do this?