AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-489390

Bertrand125's questions

Martin Hope
Bertrand125
Asked: 2024-10-26 23:26:34 +0800 CST

屏幕背光亮度设置存储在哪个文件中?

  • 5

我想从另一台具有外接显示器且操作系统中没有背光设置的计算机为笔记本电脑制作 Debian 12 Live 系统。

我需要知道存储背光亮度设置的文件,将其复制到 Live 系统中,这样当我启动 Live 系统时背光就已经调整好了。

实时系统将使用 MATE 桌面环境,GNOME 的一个分支。我想知道背光配置是否是 gsettings 的一部分?

那么,一旦调整背光亮度,我必须复制哪个文件?

debian
  • 2 个回答
  • 51 Views
Martin Hope
Bertrand125
Asked: 2024-02-11 00:08:00 +0800 CST

Debian Linux live 系统 toram:无法打开 /dev/shm 设备

  • 6

我编写了一个shell脚本来从硬盘安装创建一个squashfs live系统,以便让Linux系统仅在内存中运行。

但是当我运行toram live系统时,dmesg中出现以下错误:

systemd[1]: Failed to open /dev/shm device, ignoring: Inappropriate ioctl for device

尽管出现这个错误,toram live 系统似乎运行没有问题。

仅当在已安装的 Linux 上仅创建一个用户时,该脚本才有效,因为 squashfs 不支持 ACL,但目录 /media/username/ 需要 ACL。

这是脚本:

    #!/bin/bash
    
    # Destination directory:
    DEST=$HOME/squashfs
    
    sudo mkdir -p ${DEST}
    
    # Copying installation in destination directory:
    sudo rsync --progress --specials --perms -av -lXEog --delete / ${DEST} --one-file-system \
    --exclude=/proc/* --exclude=/tmp/* --exclude=/dev/* \
    --exclude=/sys/* --exclude=/boot/* \
    --exclude=/etc/mtab --exclude=${DEST}
    
    # Make /media/username ownership to the user, because squashfs doesn't support ACL
    MEDIA="$USER:$USER $DEST/media/$USER"
    sudo chown $MEDIA
    
    # Remove links to mounted drives in destination directory /media/username/:
    MEDIA="$DEST/media/$USER"
    sudo rm -f $MEDIA/*
    
    # Remove unwanted entries in fstab of the future live system: 
    sudo sed -i '/\/boot\/efi/d' ${DEST}/etc/fstab 
    sudo sed -i '/swap/d' ${DEST}/etc/fstab 
    sudo sed -i '/UUID=.*\ \/\ /d' ${DEST}/etc/fstab
    
    # Mount special files in order to chroot:
    sudo mount -o bind /proc ${DEST}/proc
    sudo mount -o bind /dev ${DEST}/dev
    sudo mount -o bind /dev/pts ${DEST}/dev/pts
    sudo mount -o bind /sys ${DEST}/sys
    sudo cp /etc/resolv.conf ${DEST}/etc/resolve.conf
    
    # upgrade the chrooted system, and install live-boot package 
    # as well as the lastest kernel: 
    sudo chroot ${DEST} apt-get update
    sudo chroot ${DEST} apt-get upgrade
    sudo chroot ${DEST} apt-get remove linux-image*
    sudo chroot ${DEST} apt-get install live-boot
    sudo chroot ${DEST} apt-get install linux-image-amd64
    sudo chroot ${DEST} apt-get clean
    sudo chroot ${DEST} apt clean
    
    # Umount the special files:
    sudo umount ${DEST}/proc
    sudo umount ${DEST}/dev/pts
    sudo umount ${DEST}/dev
    sudo umount ${DEST}/sys
    
    # Delete unwanted files:
    [ -n "$DEST" ] && sudo find ${DEST}/var/mail ${DEST}/var/lock ${DEST}/var/backups ${DEST}/var/tmp -type f -exec rm {} \;

    # Delete only OLD log files:
    [ -n "$DEST" ] && sudo find ${DEST}/var/log -type f -iregex '.*\.[0-9].*' -exec rm -v {} \;
    [ -n "$DEST" ] && sudo find ${DEST}/var/log -type f -iname '*.gz' -exec rm -v {} \;
    
    # Clean current log files:
    [ -n "$DEST" ] && sudo find ${DEST}/var/log -type f | while read file; do echo -n '' | sudo tee $file; done
    
    # Clean Pakcage cache:
    [ -n "$DEST" ] && sudo rm -v ${DEST}/var/cache/apt/archives/*.deb
    
    # Remove old kernel and initrd in the partition where will be installed the live system: 
    sudo rm -f /media/$USER/LIVE/live/initrd.img*
    sudo rm -f /media/$USER/LIVE/live/vmlinuz*    
    
    # Copy new kernel and initrd in the partition where will be installed the live system: 
    sudo mv -f ${DEST}/boot/initrd.img* /media/$USER/LIVE/live/initrd.img
    sudo mv -f ${DEST}/boot/vmlinuz* /media/$USER/LIVE/live/vmlinuz
    
    # Remove old shquashfs in the partition where will be installed the live system: 
    sudo rm -f /media/$USER/LIVE/live/filesystem.squashfs
    
    # Make the new squashfs:
    sudo mksquashfs ${DEST} /media/$USER/LIVE/live/filesystem.squashfs -xattrs -processors 4 -noappend -always-use-fragments

`/media/$USER/LIVE/` is where the live system partition is mounted.
   
Then I boot the live system placed on a partition with the kernel options: `toram boot=live`

编辑:

当我运行df命令时,它告诉我/dev/shm已安装在/run/live/medium.

该命令mount | grep medium告诉我它/dev/shm也安装在/usr/lib/live/mount/medium.

系统似乎在 RAM 中保存了一个包含 squashfs 的分区的副本。

当我想卸载时/run/live/medium,它告诉我这是不可能的,因为the target is active。但我已经成功卸载了/usr/lib/live/mount/medium。

所以我想知道这些问题是否有联系,是否有办法卸载/run/live/medium?

linux
  • 3 个回答
  • 141 Views
Martin Hope
Bertrand125
Asked: 2023-02-19 02:10:14 +0800 CST

在不运行任何 cups 命令的情况下手动安装打印机

  • 6

我需要通过从已安装打印机的 Debian 系统复制文件,在不运行任何 cups 命令的情况下手动安装打印机。

我必须通过这种方式进行,以便制作将安装打印机的 Debian live DVD。所以,如果我使用 Canon 安装程序,它会连接到主机的 cups 服务器,并将打印机安装在主机上,而不是安装在 chroot 中。

打印机是佳能 G3560,通过 USB 连接。设备 URI 是cnijbe2://Canon/?port=usb&serial=60A386.

我已将驱动程序的 Debian 软件包复制cnijfilter2_6.10-1_amd64.deb到config/packages.chroot/live DVD 构建目录中。

我已经将文件复制/etc/cups/ppd/G3060USB.ppd到/etc/cups/printers.conflive DVD 构建目录:config/includes.chroot_after_packages/etc/cups/.

当我运行 live 系统时,它显示打印机,但系统无法打印任何文档。

cups
  • 1 个回答
  • 31 Views
Martin Hope
Bertrand125
Asked: 2021-09-14 23:16:08 +0800 CST

在 Pluma 文本编辑器或整个系统中禁用字体连字

  • 0

我使用 live-config 和 live-build 构建了一个 debian Bullseye live-dvd。live-dvd 有 MATE 桌面环境和 pluma 文本编辑器。

问题是当我运行 live-dvd 时,pluma 正在做字体连字。字体名称是“等宽”。

我尝试将以下文本添加到/etc/fonts/conf.d/51-local.conf:

<match target="font">
  <edit name="fontfeatures" mode="append">
    <string>liga off</string>
      <string>dlig off</string>
   </edit>
</match>

但它没有用。

我认为有一种方法可以禁用连字,因为在我从 debian 网站上下载的 live-dvd 安装的系统中,在 Pluma 文本编辑器中禁用了连字。但我没有在/etc/fonts目录中找到任何与连字相关的内容。

有没有办法禁用 pluma 中的字体连字?或者,如果 pluma 正在使用系统范围的配置文件,则可能适用于整个系统?

fonts mate-desktop
  • 1 个回答
  • 98 Views
Martin Hope
Bertrand125
Asked: 2021-09-01 22:19:17 +0800 CST

删除 USB 驱动器上的写保护

  • 1

我有一个自系统崩溃以来受到写保护的 USB 闪存驱动器。在dmesg中,设备写保护先关闭,再开启。

这是dmesg:

sd 2:0:0:0: [sdb] 60566016 512-byte logical blocks: (31.0 GB/28.9 GiB)
sd 2:0:0:0: [sdb] Write Protect is off
sd 2:0:0:0: [sdb] Mode Sense: 2b 00 00 08
sd 2:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
 sdb: sdb1 sdb2 sdb3 sdb4
sd 2:0:0:0: [sdb] Write Protect is on
sd 2:0:0:0: [sdb] Mode Sense: 2b 00 80 08
sd 2:0:0:0: [sdb] Attached SCSI removable disk
EXT4-fs (sdb3): INFO: recovery required on readonly filesystem
EXT4-fs (sdb3): write access unavailable, cannot proceed (try mounting with noload)
/dev/sdb4: Can't open blockdev

这是命令的结果hdparm /dev/sdb:

/dev/sdb:
 multcount     =  0 (off)
 readonly      =  0 (off)
 readahead     = 256 (on)
 geometry      = 29573/64/32, sectors = 60566016, start = 0

我也在badblocks/deb/sdb 上运行过,它没有发现坏块。

我尝试了该命令hdparm -r0 /dev/sdb,但没有成功。hdparm 安全命令不再成功,例如:

hdparm --security-mode m --user-master m --security-unlock p /dev/sdb

这个命令说:

SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

hdparm -I /dev/sdb给出以下结果:

/dev/sdb:

ATA device, with non-removable media
Standards:
    Likely used: 1
Configuration:
    Logical     max current
    cylinders   0   0
    heads       0   0
    sectors/track   0   0
    --
    Logical/Physical Sector size:           512 bytes
    device size with M = 1024*1024:           0 MBytes
    device size with M = 1000*1000:           0 MBytes 
    cache/buffer size  = unknown
Capabilities:
    IORDY not likely
    Cannot perform double-word IO
    R/W multiple sector transfer: not supported
    DMA: not supported
    PIO: pio0 

有没有办法关闭写保护,或者我的 USB 闪存驱动器肯定丢失了?

usb-drive readonly
  • 1 个回答
  • 1363 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve