[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using ddrescue on the root partition - boot with / as read-only



On 9/14/23 03:17, Vincent Lefevre wrote:
On 2023-09-13 20:52:43 -0700, David Christensen wrote:
On 9/13/23 04:54, Vincent Lefevre wrote:
Hi,

I need to use ddrescue on the root partition of my laptop.

So I need to have the root partition mounted in read-only mode.
How can I do that?

Note that "mount -o remount,ro /" gives an error "mount point is busy"
apparently because various log files are open in write mode.

Using the recovery mode via GRUB (which mounts / in read-only mode)
is useless because the system remounts it later as rw.

Or is there a way to force a remount in read-only mode?
(I could probably trigger a disk error to make the kernel remount /
as read-only, but well...)

What symptom(s) is your laptop exhibiting that make you think that you need
to use ddrescue(1) on the root partition?

I get UNC errors like

2023-09-10T11:50:59.858670+0200 zira kernel: ata1.00: exception Emask 0x0 SAct 0xc00 SErr 0x40000 action 0x0
2023-09-10T11:51:00.117366+0200 zira kernel: ata1.00: irq_stat 0x40000008
2023-09-10T11:51:00.117431+0200 zira kernel: ata1: SError: { CommWake }
2023-09-10T11:51:00.117474+0200 zira kernel: ata1.00: failed command: READ FPDMA QUEUED
2023-09-10T11:51:00.117511+0200 zira kernel: ata1.00: cmd 60/00:50:b8:12:c5/02:00:1f:00:00/40 tag 10 ncq dma 262144 in
                                                       res 41/40:00:90:13:c5/00:02:1f:00:00/00 Emask 0x409 (media error) <F>
2023-09-10T11:51:00.117537+0200 zira kernel: ata1.00: status: { DRDY ERR }
2023-09-10T11:51:00.117560+0200 zira kernel: ata1.00: error: { UNC }
2023-09-10T11:51:00.117583+0200 zira kernel: ata1.00: supports DRM functions and may not be fully accessible
2023-09-10T11:51:00.117614+0200 zira kernel: ata1.00: supports DRM functions and may not be fully accessible
2023-09-10T11:51:00.117651+0200 zira kernel: ata1.00: configured for UDMA/133
2023-09-10T11:51:00.117681+0200 zira kernel: sd 0:0:0:0: [sda] tag#10 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s
2023-09-10T11:51:00.117953+0200 zira kernel: sd 0:0:0:0: [sda] tag#10 Sense Key : Medium Error [current]
2023-09-10T11:51:00.118165+0200 zira kernel: sd 0:0:0:0: [sda] tag#10 Add. Sense: Unrecovered read error - auto reallocate failed
2023-09-10T11:51:00.118366+0200 zira kernel: sd 0:0:0:0: [sda] tag#10 CDB: Read(10) 28 00 1f c5 12 b8 00 02 00 00
2023-09-10T11:51:00.118557+0200 zira kernel: I/O error, dev sda, sector 533009296 op 0x0:(READ) flags 0x80700 phys_seg 37 prio class 2
2023-09-10T11:51:00.118582+0200 zira kernel: ata1: EH complete
2023-09-10T11:51:00.118608+0200 zira kernel: ata1.00: Enabling discard_zeroes_data


What is the make and model of the laptop?


What is the make and model of the disk drive?


When and where do you see the above error messages?


and after these errors, the kernel remount the root partition as
read-only.


That sounds like a reasonable boot loader response to an OS drive error during boot.


Due to these errors, some files are unreadable.

badblocks says that there are 25252 bad blocks.

I'm using ddrescue before doing anything else (mainly in case things
would go worse), but I would essentially be interested in knowing
which files are affected.


Was the computer working correctly in the past?


When did you first notice the error messages? What was the computer doing at the time?


Did you make any changes to the computer (hardware, software, configuration, apps, other) immediately prior to the start of the error messages?


Does the computer now generate error messages? Consistently? What is it doing when the error messages are generated?


The laptop is in the process of being replaced, so I don't plan to
replace the disk (unless things get really wrong).


Then perhaps you should get the replacement and decommission the olde laptop (remove the disk drive, have it shredded, and resell, recycle, or reuse the laptop).


Have you read the "GNU ddrescue Manual"?

https://www.gnu.org/software/ddrescue/manual/ddrescue_manual.html

Yes.


Okay.


It sounds like you are booting a computer with OS drive issues and attempting to use that computer to trouble-shoot itself. If the issue seems minor, or is familiar, I might do the same. Otherwise, I do one or more of the following:

* Browse the disk drive manufacturer's web site for a bootable drive diagnostic tool. If available, I download the tool, burn it to media, and use it to trouble-shoot the disk drive.

* I install Debian with Xfce onto a good USB 3.0 flash drive. I then install my favorite system administration and trouble-shooting packages. I boot the USB flash drive in suitable computers and use it to trouble-shoot the computer and/or components (including disk drives).

* I remove the disk from the computer, install it another computer, and use the other computer to trouble-shoot the disk.


David


Reply to: