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-487383

Lexx Luxx's questions

Martin Hope
Lexx Luxx
Asked: 2022-05-11 02:47:05 +0800 CST

重启时,Debian 11 总是打开 /run/systemd 文件夹

  • 0

重新启动时,Debian 11 总是打开/run/systemd文件夹,而在此之前,Debian 在重新启动后没有打开任何特定文件夹。这不会导致任何问题,但仍然如此。

编辑:grep 搜索

~$ grep -r /run/systemd $HOME/.??*
/home/lunar/.bash_history:/run/systemd/resolve/stub-resolv.conf
/home/lunar/.bash_history:cd /run/systemd/resolve/stub-resolv.conf
/home/lunar/.bash_history:/run/systemd/resolve/stub-resolv.conf
/home/lunar/.cache/sessions/Thunar-24a92edbf-804a-4cab-b0ec-cc7b5d660023:URI=file:///run/systemd
grep: /home/lunar/.mozilla/firefox/3allhj9p.Default-User/places.sqlite-wal: binary file matches
grep: /home/lunar/.mozilla/firefox/3allhj9p.Default-User/places.sqlite: binary file matches

~/.cache/sessions$ cat Thunar-24a92edbf-804a-4cab-b0ec-cc7b5d660023
[Thunar-1651872231-2573164324]
PAGE=0
URI=file:///run/systemd
debian systemd
  • 1 个回答
  • 62 Views
Martin Hope
Lexx Luxx
Asked: 2022-01-06 15:55:57 +0800 CST

BIOS UEFI 模式设置

  • 0

我想在 UEFI 模式下从 LiveUSB 重新安装 Debian11:除了设置 BIOS UEFI 模式外,我是否应该在 BIOS 中禁用这两个选项:“Secure Boot: disabled”和“Load Legacy Option Rom: disabled”?

debian system-installation
  • 1 个回答
  • 147 Views
Martin Hope
Lexx Luxx
Asked: 2021-12-09 05:33:30 +0800 CST

如何修复(或重新安装)GPT 磁盘上的 UEFI 引导分区?

  • 0

Debian 11 全新安装在新硬盘、UEFI 模式和 GPT 分区磁盘上。问题是,当引导系统时,显示错误:

“未找到内部硬盘驱动器。要解决此问题,请尝试重置驱动器。没有可启动设备 - 按 F1 重试启动,按 F2 进入设置菜单,按 F5 进入 PSA。”

从 Live USB 安装,在此之前,我使用 GParted Live 创建分区。我认为可能的问题是当我创建第一个(引导)分区时,首先我设置了标签名称“efi”,然后尝试将其重命名为“/boot/efi”:GParted 立即挂起并停止响应,所以我手动关闭电源以强制 PC 关闭。标签名称中的两个斜杠“/”可能会导致问题,但我不确定。

$ efibootmgr -v
BootCurrent: 000C
Timeout: 1 seconds
BootOrder: 0000,0004,0003,0009,000A,000C
Boot0000* Debian    HD(1,GPT,c906677e-c2c2-42b5-b818-f0b19c046e95,0x800,0xfa000)/File(\EFI\Debian\shimx64.efi)
Boot0003* UEFI OS   HD(2,MBR,0xfcba9dae,0x14000,0x1388000)/File(\EFI\BOOT\BOOTX64.EFI)
Boot0004* UEFI OS   HD(2,MBR,0xb45e11b8,0xaf800,0x600000)/File(\EFI\BOOT\BOOTX64.EFI)
Boot0009* Onboard NIC(IPV4) PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/MAC(20474749bc75,0)/IPv4(0.0.0.00.0.0.0,0,0)..BO
Boot000A* Onboard NIC(IPV6) PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/MAC(20474749bc75,0)/IPv6([::]:<->[::]:,0,0)..BO
Boot000C* UEFI:  USB DISK 2.0 PMAP  PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(3,0)/HD(1,MBR,0xcd9a6b9,0x5d4,0x146a)..BO

编辑: blkid & fdisk 输出

$ sudo blkid
/dev/sdb1: BLOCK_SIZE="2048" UUID="2021-10-09-12-36-57-00" LABEL="d-live nf 11.1.0 xf amd64" TYPE="iso9660" PTUUID="0cd9a6b9" PTTYPE="dos" PARTUUID="0cd9a6b9-01"
/dev/loop0: TYPE="squashfs"
/dev/sda1: LABEL="BOOT" UUID="2F1D-01E6" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="c906677e-c2c2-42b5-b818-f0b19c046e95"
/dev/sda2: LABEL="swap" UUID="1274a782-676a-41b0-8509-92f73bd675c3" TYPE="swap" PARTUUID="4a555697-e713-400d-ae9e-613d028c7893"
/dev/sda3: LABEL="root" UUID="13503165-9c5f-498d-ab5f-0c13f11cbaa6" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="5484dedd-6adf-45af-b7b0-ba105d14528b"
/dev/sda4: LABEL="home" UUID="93c98828-5fb8-4c0e-b6bf-de8d13a9d22e" BLOCK_SIZE="4096" TYPE="ext4" PARTUUID="ae15bbdb-4e29-4dfa-aa99-b39e5377a098"
/dev/sdb2: SEC_TYPE="msdos" UUID="DEB0-0001" BLOCK_SIZE="512" TYPE="vfat" PARTUUID="0cd9a6b9-02"

$ sudo fdisk -l
Disk /dev/sda: 465.76 GiB, 500107862016 bytes, 976773168 sectors
Disk model: TOSHIBA HDWK105 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 0C3CF112-75DD-4197-9A0C-7C92036731C6

Device        Start       End   Sectors   Size Type
/dev/sda1      2048   1026047   1024000   500M EFI System
/dev/sda2   1026048   9414655   8388608     4G Linux swap
/dev/sda3   9414656  61843455  52428800    25G Linux filesystem
/dev/sda4  61843456 976773119 914929664 436.3G Linux filesystem


Disk /dev/sdb: 7.22 GiB, 7747928064 bytes, 15132672 sectors
Disk model: USB DISK 2.0    
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0cd9a6b9

Device     Boot Start     End Sectors  Size Id Type
/dev/sdb1  *        0 6240351 6240352    3G  0 Empty
/dev/sdb2        1492    6717    5226  2.6M ef EFI (FAT-12/16/32)


Disk /dev/loop0: 2.6 GiB, 2789027840 bytes, 5447320 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

在 BIOS 菜单中:[Debian(驱动器不存在)]

smartctl工具显示磁盘正常:

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

/etc/fstab 内容:

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a device; this may
# be used with UUID= as a more robust way to name devices that works even if
# disks are added and removed. See fstab(5).
#
# <file system>             <mount point>  <type>  <options>  <dump>  <pass>
UUID=2F1D-01E6                            /boot/efi      vfat    defaults,noatime 0 2
UUID=13503165-9c5f-498d-ab5f-0c13f11cbaa6 /              ext4    defaults,noatime 0 1
UUID=93c98828-5fb8-4c0e-b6bf-de8d13a9d22e /home          ext4    defaults,noatime 0 2

编辑:分开错误

root@debian:/# parted /dev/sda1
GNU Parted 3.4
Using /dev/sda1
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: Unknown (unknown)
Disk /dev/sda1: 524MB
Sector size (logical/physical): 512B/4096B
Partition Table: loop
Disk Flags: 

Number  Start  End    Size   File system  Flags
 1      0.00B  524MB  524MB  fat32

(parted) help toggle                                                      
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition
        NUMBER

    NUMBER is the partition number used by Linux.  On MS-DOS disk labels,
        the primary partitions number from 1 to 4, logical partitions from 5
        onwards.
        FLAG is one of: boot, root, swap, hidden, raid, lvm, lba, hp-service,
        palo, prep, msftres, bios_grub, atvrecv, diag, legacy_boot, msftdata,
        irst, esp, chromeos_kernel, bls_boot
(parted) toggle 1 esp                                                     
Error: No flags supported
(parted) toggle 1 bios_grub                                               
Error: No flags supported
(parted) quit
debian boot
  • 1 个回答
  • 1673 Views
Martin Hope
Lexx Luxx
Asked: 2017-11-27 06:41:16 +0800 CST

备份 Nand Flash 存储区

  • 1

板载 Linux 版本 2.6.26.5 嵌入式系统。设备使用完整图像的内核。存储在 NAND 闪存上的文件系统,Hynix NAND 32MiB 3,3V 8 位。

# printenv
baudrate=115200
ethaddr=FF:FF:FF:FF:FF:FF
netmask=255.255.255.0
ipaddr=192.168.1.1
serverip=192.168.1.100
bootfile=firetux.kernel
bootcmd1=setenv bootargs ${bootargs} && nboot 0x20200000 0 ${image_addr} && bootm 0x20200000
bootcmd2=setenv bootargs ${bootargs} && tftpboot 20200000 firetux.kernel && bootm 20200000
phymode=auto
mtdids=nand0=gen_nand
unlock=yes
verify=y
update.uboot=echo Update u-boot && tftpboot 0x20000000 nandboot.flash && nand erase 0x0 0x03ffff && nand write.jffs2 0x20000000 0x0 ${filesize}
update.kernel=echo Update kernel && tftpboot 0x20000000 uImage && nand erase 0x80000 0x180000 && nand write.jffs2 20000000 0x80000 0x180000
update.romimg=echo Update RomImage && tftpboot 0x20000000 romimage.img && nand erase 0x80000 0x13e0000&& nand write.jffs2 20000000 0x80000 ${filesize}
update.halfimg=echo Update HalfImage && tftpboot 0x20000000 recovery.img && nand erase 0x1460000 0x700000&& nand write.jffs2 20000000 0x1460000 ${filesize}
eraseenv=echo Erase Environment && nand erase 0x60000 0x20000
HwModel=Hw_Model=NXPi02
bootcmd=run bootcmd1
halfImage=half_image=0
cy_boot_code_ver=1.0.1 (Oct  6 2011 - 20:04:00)
RouterMode=Router_Mode=0
stdin=serial
stdout=serial
stderr=serial
bootcmd=run bootcmd1
image_addr=0x80000
bootargs=console=ttyS1,115200n8 rootfstype=squashfs noalign half_image=0 verify=y Hw_Model=NXPi02 Router_Mode=0
ethact=ETN1
bootdelay=3

需要从 U-boot 备份 NAND 内存 (NVRAM) 的某些区域,通过串行接口 (UART) 连接到板,网络连接不可用。U-boot 有一些管理 nand 内存的选项:

# help nand
nand info - show available NAND devices
nand device [dev] - show or set current device
nand read - addr off|partition size
nand write - addr off|partition size
    read/write 'size' bytes starting at offset 'off'
    to/from memory address 'addr', skipping bad blocks.
nand erase [clean] [off size] - erase 'size' bytes from
    offset 'off' (entire device if not specified)
nand bad - show bad blocks
nand dump[.oob] off - dump page
nand scrub - really clean NAND erasing bad blocks (UNSAFE)
nand markbad off - mark bad block at offset (UNSAFE)
nand biterr off - make a bit error at offset (UNSAFE)

尤其是,nand dump[.oob] off - dump page

什么是 nand偏移地址?没有指定要转储的分区大小。我需要转储整个 NVRAM。

设备加载内核映像后,会创建 11 个 MTD 分区:

Creating 11 MTD partitions on "gen_nand":
0x00000000-0x00060000 : "u-boot"
0x00060000-0x00080000 : "u-bootenv"
0x00080000-0x01460000 : "ROMIMAGE"
0x01460000-0x01b60000 : "HALFIMAGE"
0x00200000-0x01460000 : "LINUX_ROOTFS"
0x01b60000-0x01d60000 : "HS_FW"
0x01d60000-0x01e60000 : "FPAR"
0x01e60000-0x01ee0000 : "SNOM"
0x01ee0000-0x01f00000 : "EEPROM"
0x01f00000-0x01f80000 : "NVRAM"
0x01f80000-0x02000000 : "CA_DATA"

是0x01f00000nvram 偏移地址吗?什么是 nvram 大小?是0x80000吗?U-boot也有命令md - memory display。

=> help md
md - memory display
Usage:
md [.b, .w, .l] address [# of objects]
=>

我尝试md.b 0x01f00000 0x80000在终端上显示 nvram 的命令,但它不输出任何内容,终端挂断。


编辑:[补充]

# nand info

Device 0: NAND 32MiB 3,3V 8-bit, sector size 16 KiB
# nand device nand0
Device 0: NAND 32MiB 3,3V 8-bit... is now current device
# nand read 0x20000000 NVRAM

NAND read: mtdparts variable not set, see 'help mtdparts'
incorrect device type in NVRAM
'NVRAM' is not a number
# nand read 0x20000000 0x01f00000 0x00080000

NAND read: device 0 offset 0x1f00000, size 0x80000
 524288 bytes read: OK

BusyBox v1.10.2 (2015-09-06 10:58:05 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
# help

Built-in commands:
-------------------
    . : [ [[ alias bg break cd chdir continue echo eval exec exit
    export false fg hash help jobs let local pwd read readonly return
    set shift source test times trap true type ulimit umask unalias
    unset wait

# ext4write LINUX_ROOTFS /NVRAM.img 0x20000000 0x00080000
/bin/sh: ext4write: not found
partition terminal
  • 1 个回答
  • 3693 Views
Martin Hope
Lexx Luxx
Asked: 2017-11-24 13:07:31 +0800 CST

U-Boot 参数的简写语法

  • 0

使用方法的速记语法时,setenv bootargs 命令的正确语法是什么?例如,完整的内核环境变量是

U-Boot> setenv bootargs console=ttyS1,115200n8 rootfstype=squashfs noalign half_image=0 verify=y Hw_Model=pnx8181 Router_Mode=0 

我想在提到的代码中添加 2 个引导参数,single并且init=/bin/sh.

以下带有简写语法的命令是否正确?

setenv bootargs ${bootargs} single init=/bin/sh

任何地方都不需要单引号?

linux quoting
  • 1 个回答
  • 987 Views
Martin Hope
Lexx Luxx
Asked: 2017-11-23 06:52:55 +0800 CST

以 root 用户身份访问文件系统

  • 1

嵌入式设备,Linux 版本 2.6.26.5,U-Boot 2009.03 引导加载程序。NAND 闪存上的 ARM Linux 内核映像,从 NAND 加载。

如何以 root 用户身份访问文件系统,并重置 root 密码?是否可以通过 U-boot 参数向 Linux 内核提供single引导参数(单用户模式)来获得这个?或者通过init=/bin/bash在引导参数的末尾添加参数。bootargs和bootcmd环境变量的输出:

Kernel command line: console=ttyS1,115200n8 rootfstype=squashfs noalign half_image=0 verify=y Hw_Model=RZU017 Router_Mode=0
kernel embedded
  • 1 个回答
  • 2646 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