<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.thinkwiki.org/w/index.php?action=history&amp;feed=atom&amp;title=Script_for_locking_optical_drive</id>
	<title>Script for locking optical drive - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.thinkwiki.org/w/index.php?action=history&amp;feed=atom&amp;title=Script_for_locking_optical_drive"/>
	<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Script_for_locking_optical_drive&amp;action=history"/>
	<updated>2026-05-11T07:31:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.12</generator>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Script_for_locking_optical_drive&amp;diff=56681&amp;oldid=prev</id>
		<title>Tonko at 10:51, 10 December 2015</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Script_for_locking_optical_drive&amp;diff=56681&amp;oldid=prev"/>
		<updated>2015-12-10T10:51:01Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 10:51, 10 December 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l38&quot; &gt;Line 38:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 38:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Scripts]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Scripts]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Bluetooth]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tonko</name></author>
		
	</entry>
	<entry>
		<id>https://www.thinkwiki.org/w/index.php?title=Script_for_locking_optical_drive&amp;diff=56680&amp;oldid=prev</id>
		<title>Tonko: â†Created page with 'On some model ThinkPads it is rather easy to accidentally eject the optical drive (CD/DVD drive). The below two scripts will disable the eject button to prevent acciden...'</title>
		<link rel="alternate" type="text/html" href="https://www.thinkwiki.org/w/index.php?title=Script_for_locking_optical_drive&amp;diff=56680&amp;oldid=prev"/>
		<updated>2015-12-10T10:50:45Z</updated>

		<summary type="html">&lt;p&gt;â†Created page with &amp;#039;On some model ThinkPads it is rather easy to accidentally eject the optical drive (CD/DVD drive). The below two scripts will disable the eject button to prevent acciden...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;On some model ThinkPads it is rather easy to accidentally eject the optical drive (CD/DVD drive). The below two scripts will disable the eject button to prevent accidental ejection.&lt;br /&gt;
The tray can still be ejected afterwards by either right clicking in a graphical file manager on the CD icon and choosing eject, or from the commandline with the 'eject' command.&lt;br /&gt;
&lt;br /&gt;
Note: These scripts are only for modern Linux distributions utilizing systemd.&lt;br /&gt;
&lt;br /&gt;
Create a file as root named:&lt;br /&gt;
/etc/systemd/system/cdrom-lock-on-boot.service&lt;br /&gt;
with the following contents;&lt;br /&gt;
&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=CD-ROM lock on boot&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/bin/eject -i on /dev/sr0&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
 WantedBy=multi-user.target&lt;br /&gt;
&lt;br /&gt;
In addition, also create this file:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;/etc/systemd/system/cdrom-lock-on-resume.service&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
with the following contents;&lt;br /&gt;
 [Unit]&lt;br /&gt;
 Description=CD-ROM lock on resume&lt;br /&gt;
 After=suspend.target&lt;br /&gt;
 &lt;br /&gt;
 [Service]&lt;br /&gt;
 Type=simple&lt;br /&gt;
 ExecStart=/usr/bin/eject -i on /dev/sr0&lt;br /&gt;
 &lt;br /&gt;
 [Install]&lt;br /&gt;
Now we need to enable the scripts as follows;&lt;br /&gt;
 systemctl enable cdrom-lock-on-boot.service&lt;br /&gt;
 systemctl enable cdrom-lock-on-resume.service&lt;br /&gt;
&lt;br /&gt;
Now after a reboot, or suspend/resume cycle the eject button will be locked. Alternatively we can lock it immediately with the following command;&lt;br /&gt;
 /usr/bin/eject -i on /dev/sr0&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripts]]&lt;br /&gt;
[[Category:Bluetooth]]&lt;/div&gt;</summary>
		<author><name>Tonko</name></author>
		
	</entry>
</feed>