ฉันคลิกขวาที่ไอคอน DVD ใน Unity Launcher เพื่อนำออก แต่แทนที่จะกดปุ่ม 'Eject' ฉันพลาดและกดตัวเลือก 'Unlock from Launchpad' แทน
ฉันจะนำดิสก์ออกจากไดรฟ์ในขณะที่ตัวเลือก Launcher หายไปได้อย่างไร
ฉันคลิกขวาที่ไอคอน DVD ใน Unity Launcher เพื่อนำออก แต่แทนที่จะกดปุ่ม 'Eject' ฉันพลาดและกดตัวเลือก 'Unlock from Launchpad' แทน
ฉันจะนำดิสก์ออกจากไดรฟ์ในขณะที่ตัวเลือก Launcher หายไปได้อย่างไร
คำตอบ:
เพื่อนำดิสก์ออกจากไดรฟ์ไม่ว่าจะเป็นซีดีหรือดีวีดีให้เปิดเทอร์มินัลแล้วก็ดำเนินการejectคำสั่ง
sudoมันต้องมี
ejectใช้งานได้สำหรับฉันแล้วหยุดทำงานโดยมีข้อผิดพลาดต่อไปนี้: "eject: / dev / cdrom: ไม่พบจุดติดตั้งหรืออุปกรณ์ที่มีชื่อที่กำหนด" หลังจากรันeject /dev/sr0ฉันอีกครั้งอาจจะใช้eject, eject -Tฯลฯ
วิธีเปิดไดรฟ์ซีดี / นำแผ่นซีดีออก:
ejecteject -teject -Tคำสั่งทั้งหมดเหล่านี้สามารถพิมพ์ลงในกล่องโต้ตอบเรียกใช้ ( Alt+ F2)
สำหรับตัวเลือกเพิ่มเติมให้พิมพ์eject -hลงในเทอร์มินัล
สรรพนามของฉันคือเขา / เขา
คำสั่ง:
ejecteject -talias opentray='eject'
มีปัญหาเล็กน้อยเกิดขึ้นเมื่อนำไดรฟ์ออก บางครั้งพวกเขาไม่ต้องการนำแผ่นดิสก์ออกเนื่องจากมีการติดตั้ง ฯลฯ คุณสามารถแทนที่ด้วยeject -l /media/mountpointหรือ ( /mnt/mountpoint) ฉันเขียนฟังก์ชั่นที่สามารถเรียกได้โดยพิมพ์เพียงopentrayบรรทัดคำสั่งของคุณ
ใช้งานได้เฉพาะในกรณีที่
/dev/sr0(เช่นเดียวกับ/dev/cdromที่เชื่อมโยงกับสัญลักษณ์/dev/sr0)function opentray ()
{
mountdir="/media/DVD"
if [ -d "${mountdir}" ] # If directory ${mountdir} exists
then
if [ $(mount | grep -c "${mountdir}") = 1 ] # If drive is mounted, then
then
echo "/dev/sr0 is now mounted to ${mountdir}. I'll try to unmount it first and eject/open the tray."
umount -l "${mountdir}"
rm -r "${mountdir}"
sysctl -w dev.cdrom.autoclose=0 # Ensure drive doesn't auto pull tray back in.
eject
exit
else
echo "/dev/sr0 is not mounted. Opening the tray should be easy. Ejecting/opening now."
rm -r "${mountdir}"
sysctl -w dev.cdrom.autoclose=0 # Ensure drive doesn't auto pull tray back in.
eject
exit
fi
else
echo 'The directory "${mountdir}" does not exist. Ejecting/opening the tray.'
sysctl -w dev.cdrom.autoclose=0 # Ensure drive doesn't auto pull tray back in.
eject
exit
fi
}
เพื่อความสมบูรณ์คุณสามารถเพิ่มนามแฝงนี้ลงใน.bashrc(หรือ.bash_aliasesไฟล์) ของคุณเพื่อดึงถาดกลับเข้ามาจากบรรทัดคำสั่ง คุณไม่จำเป็นต้องรูท
alias closetray='eject -t'
ในแอปพลิเคชัน "Terminal" ให้ป้อน:
ejecteject --forceeject --force→eject: unrecognized option '--force'
eject -F