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
    • 最新
    • 标签
主页 / unix / 问题

问题[sd-card](unix)

Martin Hope
giovi321
Asked: 2024-04-06 20:35:45 +0800 CST

解释 badblocks 的输出:什么时候该更换 microSD 卡?

  • 11

语境

我正在运行一个带有 microSD 的树莓派零,因为它是设计的。但是,对于这个特定的应用程序,我无法像通常使用树莓派那样使用只读系统。

客观的

密切关注 microSD 的健康状态(并最终以某种方式收到通知,表明需要更换 microSD)。

问题

  1. 监控 microSD 健康状态的最佳方法是什么(否,fsck因为我无法在系统运行时卸载 microSD);
  2. 就实用性和有效性而言,以下提出的方法是否是最佳解决方案?

提议的方法

我想使用badblocks输出来监视 microSD 的状态,并最终在适当的时候更换它。但什么时候该更换 microSD 呢?多少个坏块算太多?我应该查看写入错误或读取错误还是两者都查看?

我做了以下考虑:microsd 卡会自动重新分配坏块之外的数据。因此,如果 microSD 已满 80%,则有 20% 的块可能会“变坏”,但仍可保持 microSD 运行。添加一点置信区间,我们是否可以说,如果badblocks输出的坏块数量低于空闲空间块的 50%,那么使用 SD 卡仍然是安全的?

澄清:

  • 区块总数:100
  • 可用空间(以块为单位):20
  • 接受损坏的块的最大数量(或其他):10
sd-card
  • 1 个回答
  • 308 Views
Martin Hope
junefish
Asked: 2023-03-25 09:32:38 +0800 CST

lsblk 无法识别 microSD 卡,dmesg 出错

  • 5

我得到了一张新的金士顿 1Tb microSD 卡,错误地立即将其放入我的 Steam 平台,而不是先在我的笔记本电脑上对其进行格式化。Steam 卡组格式卡在“测试”状态,即使我在取出卡之前关闭了设备,它现在也已损坏。

在我的 Pop!OS 笔记本电脑上,我尝试了类似问题帖子中推荐的一堆东西:

  • 当我运行时它没有出现在列表中lsblk
  • dmesg当我插入我的 USB SD 读卡器时,运行会出现以下错误(我已经将此读卡器与其他 microSD 卡一起使用了):
[71674.229961] usb 2-1: New USB device found, idVendor=05e3, idProduct=0751, bcdDevice=14.04
[71674.229978] usb 2-1: New USB device strings: Mfr=3, Product=4, SerialNumber=0
[71674.229983] usb 2-1: Product: USB Storage
[71674.229987] usb 2-1: Manufacturer: USB Storage
[71674.876426] BPF:     042_EXPECTED_PRESENT type_id=1726 bits_offset=2432
[71674.876434] BPF:  
[71674.876437] BPF: Invalid name
[71674.876438] BPF: 
[71674.876442] failed to validate module [usb_storage] BTF: -22
[71674.926925] BPF:     042_EXPECTED_PRESENT type_id=1726 bits_offset=2432
[71674.926951] BPF:  
[71674.926955] BPF: Invalid name
[71674.926959] BPF: 
[71674.926965] failed to validate module [usb_storage] BTF: -22
  • 因为lsblk没有给我设备名称,所以我无法使用dd或类似的建议。
  • 它不会出现在 Gparted 中。

我可以做些什么来恢复/格式化 SD 卡?我不关心数据丢失。

sd-card
  • 1 个回答
  • 32 Views
Martin Hope
Developer_ken
Asked: 2022-07-06 08:55:22 +0800 CST

我可以在插入 sd 卡时从内置 emmc 启动我的开发板吗?

  • 0

这有点像 U-Boot 相关问题。我不太确定我应该发布到哪个站点,但是当我启动 Ubuntu 时,我将它发布到这里。

基本上,我用 Allwinner H3 SOC 购买了便宜的 Nanopi Neo Air。我正在使用官方的 ubuntu 20.04 映像。我使用提供的 eflasher 工具将系统刷新到板载 emmc 中。

板载 emmc 对我的用例来说太小了,但它比 sd 卡快。我希望我的系统从 emmc 启动,同时使用 sd 卡作为额外存储。所以我将我的 sd 卡格式化为一个大的 ext4 分区,然后重新启动我的系统。

启动时,我的 u-boot 对插入的 sd 卡不满意。它总是从 sd 卡启动,即使它是空的(所以它根本不会启动)。

我尝试了什么
我试图通过向其中写入零来清除我的 SD 卡中的所有数据。那没有帮助。

我想要什么
从 emmc 启动并插入 sd 卡

任何信息表示赞赏。

boot sd-card
  • 1 个回答
  • 39 Views
Martin Hope
Rho Phi
Asked: 2021-12-18 00:14:01 +0800 CST

为什么 dd 给我的 SD 卡与其来源不同?

  • 0

我有一个 32 Gb SD 卡,上面有我的操作系统(Raspberry Pi OS Buster),我希望使用 standard 进行备份dd,使用sudo dd if=/dev/sdb of=/mnt/toshiba2tb/pi20211217.img bs=1M

源 SD 卡在lsblk --fs

db
├─sdb1      vfat   RECOVERY 796F-5014
├─sdb2
├─sdb5      ext4   SETTINGS 3b129a7c-44fe-4062-8819-2be9ec66edea
├─sdb6      vfat   boot     3830-AECC
└─sdb7      ext4   root     92847503-3b1f-4e22-9fa0-f6794b8fed0c

映像完成后,我将其复制dd到(全新的)新卡上sudo dd if=/mnt/toshiba2tb/pi20211217.img of=/dev/sdb bs=1M,并获得了一个不同的分区表,它甚至无法启动 RPi

sdb
├─sdb1      vfat   RECOVERY 796F-5014
└─sdb2

fdisk确认和报告和荒谬2T的划分......这是怎么回事?

$ sudo fdisk -l /dev/sdb
Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Invalid flag 0xffff of EBR (for partition 5) will be corrected by w(rite).
Disk /dev/sdb: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Disk model: LRWM04U
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: 0x000edc50

Device     Boot      Start        End    Sectors  Size Id Type
/dev/sdb1             8192    3781250    3773059  1.8G  e W95 FAT16 (LBA)
/dev/sdb2          3781251   60751871   56970621 27.2G  5 Extended
/dev/sdb5       4298748546 8593715840 4294967295    2T ff BBT

更多信息来自sudo /sbin/fdisk -l /mnt/toshiba2tb/pi20211217.img

$ sudo /sbin/fdisk -l /mnt/toshiba2tb/pi20211217.img
Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Invalid flag 0xffff of EBR (for partition 5) will be corrected by w(rite).
Disk /mnt/toshiba2tb/pi20211217.img: 29 GiB, 31104958464 bytes, 60751872 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
Disklabel type: dos
Disk identifier: 0x000edc50

Device                          Boot      Start        End    Sectors  Size Id Type
/mnt/toshiba2tb/pi20211217.img1            8192    3781250    3773059  1.8G  e W95 FAT16 (LBA)
/mnt/toshiba2tb/pi20211217.img2         3781251   60751871   56970621 27.2G  5 Extended
/mnt/toshiba2tb/pi20211217.img5      4298748546 8593715840 4294967295    2T ff BBT

我还尝试dd_rescue了一个新的图像文件,它似乎直到最后都没有错误。

$ sudo dd_rescue /dev/sdb /mnt/toshiba2tb/pi20211217.rescue.img
dd_rescue: (info) expect to copy 30375936kB from /dev/sdb
dd_rescue: (info): ipos:  30375936.0k, opos:  30375936.0k, xferd:  30375936.0k
                   errs:      0, errxfer:         0.0k, succxfer:  30375936.0k
             +curr.rate:    10374kB/s, avg.rate:    20375kB/s, avg.load: 21.2%
             >----------------------------------------.<  99%  ETA:  0:00:00
dd_rescue: (info): read /dev/sdb (30375936.0k): EOF
dd_rescue: (info): Summary for /dev/sdb -> /mnt/toshiba2tb/pi20211217.rescue.img:
dd_rescue: (info): ipos:  30375936.0k, opos:  30375936.0k, xferd:  30375936.0k
                   errs:      0, errxfer:         0.0k, succxfer:  30375936.0k
             +curr.rate:        0kB/s, avg.rate:    20312kB/s, avg.load: 21.1%
             >----------------------------------------.<  99%  ETA:  0:00:00

不幸的是,获得的文件仍然显示出损坏的迹象

$ sudo /sbin/fdisk -l /mnt/toshiba2tb/pi20211217.rescue.img
Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Invalid flag 0xffff of EBR (for partition 5) will be corrected by w(rite).
Disk /mnt/toshiba2tb/pi20211217.rescue.img: 29 GiB, 31104958464 bytes, 60751872 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
Disklabel type: dos
Disk identifier: 0x000edc50

Device                                 Boot      Start        End    Sectors  Size Id Type
/mnt/toshiba2tb/pi20211217.rescue.img1            8192    3781250    3773059  1.8G  e W95 FAT16 (LBA)
/mnt/toshiba2tb/pi20211217.rescue.img2         3781251   60751871   56970621 27.2G  5 Extended
/mnt/toshiba2tb/pi20211217.rescue.img5      4298748546 8593715840 4294967295    2T ff BBT

只是为了检查一下,我确实刷新了此映像,它与所有其他映像具有相同的问题,即引导找不到“设置”分区并永远挂在那里...

假设它可能只是一个分区表问题,我已将原始 SD 的分区表转储到使用sfdisk -d /dev/sdb > pi.partitiontable. 它打印出一些明智的东西

$ cat  pi.partitiontable
label: dos
label-id: 0x000edc50
device: /dev/sdb
unit: sectors

/dev/sdb1 : start=        8192, size=     3773059, type=e
/dev/sdb2 : start=     3781251, size=    56970621, type=5
/dev/sdb5 : start=     3784704, size=       65534, type=83
/dev/sdb6 : start=     3850240, size=      147454, type=c
/dev/sdb7 : start=     3997696, size=    56754176, type=83

然后我将此分区表复制到新复制的 SD 卡 $ sudo sfdisk /dev/sdb < pi.partitiontable上

Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Ignoring extra data in partition table 5.
Invalid flag 0xffff of EBR (for partition 5) will be corrected by w(rite).
Checking that no-one is using this disk right now ... OK

Disk /dev/sdb: 29.7 GiB, 31914983424 bytes, 62333952 sectors
Disk model: LRWM04U
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: 0x000edc50

Old situation:

Device     Boot      Start        End    Sectors  Size Id Type
/dev/sdb1             8192    3781250    3773059  1.8G  e W95 FAT16 (LBA)
/dev/sdb2          3781251   60751871   56970621 27.2G  5 Extended
/dev/sdb5       4298748546 8593715840 4294967295    2T ff BBT

>>> Script header accepted.                                                                                                                                                                            >>> Script header accepted.
>>> Script header accepted.
>>> Script header accepted.
>>> Created a new DOS disklabel with disk identifier 0x000edc50.
/dev/sdb1: Created a new partition 1 of type 'W95 FAT16 (LBA)' and of size 1.8 GiB.
Partition #1 contains a vfat signature.
/dev/sdb2: Created a new partition 2 of type 'Extended' and of size 27.2 GiB.
/dev/sdb3: Created a new partition 5 of type 'Linux' and of size 32 MiB.
/dev/sdb6: Sector 3850240 is already allocated.
Created a new partition 6 of type 'W95 FAT32 (LBA)' and of size 72 MiB.
/dev/sdb7: Sector 3997696 is already allocated.
Created a new partition 7 of type 'Linux' and of size 27.1 GiB.
/dev/sdb8: Done.

New situation:
Disklabel type: dos
Disk identifier: 0x000edc50

Device     Boot   Start      End  Sectors  Size Id Type
/dev/sdb1          8192  3781250  3773059  1.8G  e W95 FAT16 (LBA)
/dev/sdb2       3781251 60751871 56970621 27.2G  5 Extended
/dev/sdb5       3784704  3850237    65534   32M 83 Linux
/dev/sdb6       3852286  3999739   147454   72M  c W95 FAT32 (LBA)
/dev/sdb7       4001788 60751871 56750084 27.1G 83 Linux

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

使用此卡,启动会抱怨设置分区已损坏,因此要求重新安装操作系统。这与之前的错误不同,可能是由于(我猜)我从旧卡中取出并复制到新卡上的分区表存在一些错位或轻微不兼容。我仍然想知道这种方法是否可行,也许需要对分区表进行一些调整......

dd sd-card
  • 3 个回答
  • 185 Views
Martin Hope
Rantanplan
Asked: 2021-09-12 12:43:24 +0800 CST

SD卡:无法读取分区表

  • 0

我有一张我的笔记本电脑无法读取的 micro sd 卡,既不安装也不显示在lsblkor中blkid。使用tail -f /var/log/syslog, 说明有问题:

[ 3250.544073] tifm_core: MMC/SD card detected in socket 0:3
[ 3250.689963] mmc0: new SDHC card at address 0007
[ 3250.693295] mmcblk0: mmc0:0007 SD16G 14.4 GiB 
[ 3250.695323] mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0xb00
[ 3250.763994] mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0xb00
[ 3250.764048] mmcblk0: retrying using single block read
[ 3250.764462] mmcblk0: error -84 transferring data, sector 0, nr 8, cmd response 0x900, card status 0x0
[ 3250.764901] mmcblk0: error -84 transferring data, sector 1, nr 7, cmd response 0x900, card status 0x0
[ 3250.765534] mmcblk0: error -84 transferring data, sector 2, nr 6, cmd response 0x900, card status 0x0
[ 3250.765963] mmcblk0: error -84 transferring data, sector 3, nr 5, cmd response 0x900, card status 0x0
[ 3250.766391] mmcblk0: error -84 transferring data, sector 4, nr 4, cmd response 0x900, card status 0x0
[ 3250.766817] mmcblk0: error -84 transferring data, sector 5, nr 3, cmd response 0x900, card status 0x0
[ 3250.767246] mmcblk0: error -84 transferring data, sector 6, nr 2, cmd response 0x900, card status 0x0
[ 3250.767672] mmcblk0: error -84 transferring data, sector 7, nr 1, cmd response 0x900, card status 0x0
[ 3251.776249] tifm_sd0:3 : card failed to respond for a long period of time (12, 9)
[ 3251.776273] tifm0 : demand removing card from socket 0:3
[ 3251.776372] mmcblk0: error -123 sending status command, retrying
[ 3251.776381] mmcblk0: error -123 sending status command, retrying
[ 3251.776389] mmcblk0: error -123 sending status command, aborting
[ 3251.776530] mmcblk0: error -123 sending status command, retrying
[ 3251.776539] mmcblk0: error -123 sending status command, retrying
[ 3251.776546] mmcblk0: error -123 sending status command, aborting
[ 3251.776573] ldm_validate_partition_table(): Disk read failed.
[ 3251.776638] mmcblk0: error -123 sending status command, retrying
[ 3251.776646] mmcblk0: error -123 sending status command, retrying
[ 3251.776654] mmcblk0: error -123 sending status command, aborting
[ 3251.776737] mmcblk0: error -123 sending status command, retrying
[ 3251.776745] mmcblk0: error -123 sending status command, retrying
[ 3251.776752] mmcblk0: error -123 sending status command, aborting
[ 3251.776836] mmcblk0: error -123 sending status command, retrying
[ 3251.776844] mmcblk0: error -123 sending status command, retrying
[ 3251.776852] mmcblk0: error -123 sending status command, aborting
[ 3251.776934] mmcblk0: error -123 sending status command, retrying
[ 3251.776942] mmcblk0: error -123 sending status command, retrying
[ 3251.776950] mmcblk0: error -123 sending status command, aborting
[ 3251.776974] Dev mmcblk0: unable to read RDB block 0
[ 3251.777041] mmcblk0: error -123 sending status command, retrying
[ 3251.777049] mmcblk0: error -123 sending status command, retrying
[ 3251.777056] mmcblk0: error -123 sending status command, aborting
[ 3251.777138] mmcblk0: error -123 sending status command, retrying
[ 3251.777147] mmcblk0: error -123 sending status command, retrying
[ 3251.777154] mmcblk0: error -123 sending status command, aborting
[ 3251.777248] mmcblk0: error -123 sending status command, retrying
[ 3251.777257] mmcblk0: error -123 sending status command, retrying
[ 3251.777264] mmcblk0: error -123 sending status command, aborting
[ 3251.777346] mmcblk0: error -123 sending status command, retrying
[ 3251.777355] mmcblk0: error -123 sending status command, retrying
[ 3251.777362] mmcblk0: error -123 sending status command, aborting
[ 3251.777444] mmcblk0: error -123 sending status command, retrying
[ 3251.777452] mmcblk0: error -123 sending status command, retrying
[ 3251.777460] mmcblk0: error -123 sending status command, aborting
[ 3251.777484] mmcblk0: unable to read partition table
[ 3251.781293] mmc0: card 0007 removed
systemd-udevd[2305]: inotify_add_watch(9, /dev/mmcblk0, 10) failed: No such file or directory
[ 3251.844043] tifm_core: MMC/SD card detected in socket 0:3
[ 3252.089018] mmc0: error -110 whilst initialising SD card
[ 3252.269558] mmc0: error -110 whilst initialising SD card

我尝试了几件事(例如sudo apt-get install exfat-fuse exfat-utils)或将tifm_sd添加到/etc/modules.,但都没有成功。sd 卡(Sony micro sd、HC、16 GB、90 MB/s、SR 16UY3 在我的 Android 手机和相机上运行良好,但在我的笔记本电脑(Ubuntu 18.04、Acer TravelMate 4500)上运行良好。同样使用GParted,我看不到卡。其他sd卡在笔记本电脑上工作正常。

有关 SD 卡读卡器的信息(我还更新了驱动程序以排除可能的原因)通过lspci:

CardBus bridge [0607]: Texas Instruments PCIxx21/PCIxx11/PCIx515 PC Card Controller [104c:8031]
    Subsystem: Acer Incorporated [ALI] Extensa 3000 series laptop [1025:0064]
    Flags: bus master, medium devsel, latency 168, IRQ 10
    Memory at e0209000 (32-bit, non-prefetchable) [size=4K]
    Bus: primary=02, secondary=03, subordinate=06, sec-latency=176
    Memory window 0: 80000000-83ffffff (prefetchable)
    Memory window 1: 90000000-93ffffff
    I/O window 0: 00003000-000030ff
    I/O window 1: 00003400-000034ff
    16-bit legacy interface ports at 0001
    Capabilities: [a0] Power Management version 2
    Kernel driver in use: yenta_cardbus
    Kernel modules: yenta_socket

感谢您的提示!如果您需要任何其他信息,请告诉我!

filesystems sd-card
  • 1 个回答
  • 130 Views
Martin Hope
Frank van Wensveen
Asked: 2020-02-19 02:29:26 +0800 CST

FAT/FAT32/VFAT 文件系统上的文件顺序

  • 1

我有几个音频设备(汽车收音机、便携式收音机、MP3 播放器),它们使用 SD 卡和带有 FAT 文件系统的 USB 记忆棒。由于这些设备的智能有限,它们不会按名称对 FAT FS 上的文件名进行排序,而只是按照它们被复制到 SD 卡的顺序播放它们。

在 MS DOS 和 MS Windows 中,这不是问题。使用一个简单的实用程序按字母顺序对文件进行排序,然后按该顺序复制它们就可以了。但是,在 Linux 上,从 ext4 文件系统复制的文件不会以与读取和复制它们的顺序相同的顺序在 FAT FS 上结束,大概是因为有一种缓冲机制可以提高效率,但不会过于担心文件最终在目标设备上的物理顺序。

我也尝试在 Virtual Box VM 中使用 Windows,但最终文件的写入顺序与从 Linux 文件系统中读取的顺序不同。

有没有办法(除了手动复制它们并等待所有写入缓冲区被刷新)来确保文件按照从 ext4 文件系统中读取的顺序最终出现在 FAT SD 目标上?

file-copy sd-card
  • 1 个回答
  • 245 Views
Martin Hope
gatorback
Asked: 2020-02-03 11:14:03 +0800 CST

可以对 SD 卡映像文件执行 zerofree 处理吗?

  • 1

在此处输入图像描述

Ubuntu 16.04:使用以下命令创建了 64GB SD 卡映像:

date; sudo sh -c 'pv /dev/mmcblk0 >rpi4_Ubuntu18.1_64GB.image'; date

rasbperry pi SD 卡配备 Ubuntu 18.1

Ubuntu 16.04 笔记本电脑可以:

  • 挂载 .image 文件?
  • 在 .image 文件的挂载点上运行 zerofree?
  • 卸载 .image 文件?

我知道可以将图像文件恢复到 SD 卡并使用zerofree处理卡并再次捕捉图像。如果能够在不将它们恢复到 SD 卡的情况下处理多个 .image 文件,那就太好了。

更新:测试结果

映像成功挂载到 /dev/loop9p2:

$ sudo losetup -P /dev/loop9 rpi4_Ubuntu18.1_64GB.image
$ ls -l /dev/loop9*
brw-rw---- 1 root disk   7, 9 Feb  2 19:12 /dev/loop9
brw-rw---- 1 root disk 259, 0 Feb  2 19:12 /dev/loop9p1
brw-rw---- 1 root disk 259, 1 Feb  2 19:12 /dev/loop9p2

零故障:

$ zerofree -v /dev/loop9p2
zerofree: failed to open filesystem /dev/loop9p2

需要零零sudo:

$ sudo zerofree -v /dev/loop9p2
14346339/14348998/15073019
  • 14346339 遇到的非零块数
  • 14348998 文件系统中的空闲块数
  • 15073019 文件系统内的总块数

奖励:使用脚本pishrink减小图像大小

sd-card disk-image
  • 1 个回答
  • 737 Views
Martin Hope
gatorback
Asked: 2019-06-01 03:36:30 +0800 CST

复制 SD 卡

  • 3

背景

已为 Raspberry pi 配置了 SD 卡。目标是完全复制 SD 卡(操作系统、应用程序、数据),以便副本在 rPi 中的功能与原始\主 SD 卡完全相同。

更新:假设:

  • 复制将在配置有类似 UNIX 操作系统的笔记本电脑上执行
  • 不应从 rPi 执行复制
  • 目标 SD 卡的品牌/型号相同
  • 源 SD 卡使用不同的文件系统进行分区:

在此处输入图像描述

问题

哪些 UNIX 克隆选项适用于带有 SD 卡插槽和 USB SD 卡读卡器/写卡器的 Ubuntu HP 笔记本电脑。

USB SD卡RW是读卡器还是写卡器有区别吗?

一个目标(约束)是避免购买额外的硬件。

解决方案观察

date; sudo sh -c 'cat sdcard.image >/dev/mmcblk0'; date

2019 年 6 月 3 日星期一 17:53:18 EDT [sudo] 用户密码:2019 年 6 月 3 日星期一 23:42:17 EDT

date; sudo sh -c 'pv sdcard.image >/dev/mmcblk0'; date

2019 年 6 月 4 日星期二 00:33:50 EDT [sudo] 用户密码:119GiB 6:06:12 [5.56MiB/s] [=================== ============>] 100%
2019 年 6 月 4 日星期二 06:43:05 EDT

对闪存 SD 卡的 gParted 分析显示相同的分区:

在此处输入图像描述

macOS\OSX

要查找 SD 卡的位置:

diskutil list

写入时请务必卸载 SD 卡:

sudo diskutil unmount /dev/disk#

其中 # 是 1,2,3...

storage sd-card
  • 2 个回答
  • 3682 Views
Martin Hope
arshan
Asked: 2018-12-29 06:29:21 +0800 CST

VFS:无法打开根设备 mmcblk1p1 或未知块 (179,33)

  • 1

我正在尝试在基于 Nvidia TK1 的定制板上运行 Linux。当我尝试从 SD 卡启动板时,出现以下错误:

VFS: Cannot open root device "mmcblk1p1" or unknown-block(179,33): error -30
Please append a correct "root=" boot option; here are the available partitions:
 b300        30539776 mmcblk0  driver: mmcblk
   b301        14680064 mmcblk0p1 7369c667-ff51-ec4a-29cd-baaba3cee346
   b302            4096 mmcblk0p2 f854c27c-e81b-8de7-765a-2e9442bfc99a
   b303           65536 mmcblk0p3 b70d3266-5831-5aa3-255d-051742ea5ed4
   b304            4096 mmcblk0p4 c6cdb2ab-b49b-1154-0e82-7441842bdc87
   b305            4096 mmcblk0p5 a13ee970-e141-67fc-3e01-7e97dcea6b96
   b306            4096 mmcblk0p6 2a5c388f-b0ec-fb3b-32af-3c554123db5c
   b307            4096 mmcblk0p7 43fe1a02-fafb-3aaa-fb29-d1e85fa37c94
   b308            2048 mmcblk0p8 61bed875-f989-bb5c-a899-0f9573eff1b3
   b309          571392 mmcblk0p9 00f7ef05-a1e9-e53a-ca0b-cbd3493164bd
 b310            4096 mmcblk0rpmb  (driver?)
 b320        15558144 mmcblk1  driver: mmcblk
   b321        15557103 mmcblk1p1 5d52e9ff-6261-41c9-9816-73affe28b267
 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(179,33)

我已确保为内核提供了正确的根变量,即root=/dev/mmcblk1p1 rw. 我还确保该卡已正确格式化并且不是只读的。

我什至尝试查看内核源代码,error -30但找不到sys_mount()返回此错误的函数定义。

有人可以指出必须发生这种情况的原因吗?谢谢。

linux-kernel sd-card
  • 1 个回答
  • 1052 Views
Martin Hope
Gregor
Asked: 2018-12-16 12:33:17 +0800 CST

USB mmcblk 支持(realtek 或其他)

  • 9

USB 读卡器能否显示为 /dev/mmcblk0 并支持 MMC ioctl 命令?

我看到有一些内核驱动程序模块,例如:

rtsx_usb_sdmmc.ko  (rtsx-usb-sdmmc)
rtsx_usb.ko (rtsx-usb)

这些可以使连接到 USB 总线的 realtek 读卡器显示为真正的 MMC 设备吗?我注意到我可以访问的所有 USB 读卡器都显示为 /dev/sdX。这似乎是一个模拟的 SCSI 设备。这些模拟 SCSI 设备不支持所有 MMC 操作 (ioctl)。

是否有某些 USB 连接的读卡器(芯片)显示为 /dev/mmcblkX 而不是 /dev/sdX?

这将允许卡支持 blkdiscard、trim 或 fstrim。

usb sd-card
  • 1 个回答
  • 1149 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