From nobody Sat Apr 15 21:21:51 2023 X-Original-To: questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PzR8x0TJJz456WG for ; Sat, 15 Apr 2023 21:22:09 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Received: from holgerdanske.com (holgerdanske.com [IPv6:2001:470:0:19b::b869:801b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "holgerdanske.com", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PzR8w0vW5z3Kmy for ; Sat, 15 Apr 2023 21:22:08 +0000 (UTC) (envelope-from dpchrist@holgerdanske.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=holgerdanske.com header.s=nov-20210719-112354 header.b=jcwmvXtS; spf=pass (mx1.freebsd.org: domain of dpchrist@holgerdanske.com designates 2001:470:0:19b::b869:801b as permitted sender) smtp.mailfrom=dpchrist@holgerdanske.com; dmarc=pass (policy=none) header.from=holgerdanske.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=holgerdanske.com; s=nov-20210719-112354; t=1681593720; bh=u9jHfRQ0p70K+z/1TE4spjoVlw7vO0Ssy48fmghAV2U=; h=Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To: References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; b=jcwmvXtSzWJz7m4uvnxfJew+mkhVO6Ulw7ZQVb7Tq5GCdUy+EEj6oVd+x5Oq/qpQI t4ZnWjmeb5rUCEoHaY+ldh71ztBXSR0OrDbwqeslh7Yrt1wR7Wnd5TKEi+6x+UFPO1 ktOeWLrrjYnc5z+FQ6+LTaARQFX7TYm2uvt3C7YUANAKp/Cr01AotMHA5BFBWk5x3w jyJb3A69yBpwzFlgp/gmDiHn0v94+ctQcoaVfqkGf6rgw9gKU9r9jj802IFePwqxOO V1Q3Yor4ap3dEFpkqojGJKNZhcn5Mgu7QXK/XoxsYXcUbjKwgY0yLiO7uHmDwDUBzC mV7XTU4iNbSV7lx0uBEwn6301gjxtJUa2dEaqYWbSkTI6SsiQdgFIB97xKWlvzEwDt VagPGULc3qVyRJtT2dteY8OrgYrdngchdyzvsqcow9JPjz9+sm8qd+PukZ1iu5EPG3 wV5GNfqZ+dWNZnxpen2CeGNOy+8WZO0XdHzXi487QuSgRPiUhUjJGVtldafx+AA4e3 CrFvuipI/X+G2EGrPsBzRUhbG8eC6F1A1/MSrD2YcPatdIoN8txS2A1ddg/v3HLqGV uSv8nL8oKaY0AE0yXaixPkbGFxc2a9ytg7YHqavnLSP8Edd+yn6vNpUv21vttTgmyb DMrR6+xoIlkstrDa/O3lZuOk= Received: from 99.100.19.101 (99-100-19-101.lightspeed.frokca.sbcglobal.net [99.100.19.101]) by holgerdanske.com with ESMTPSA (TLS_AES_128_GCM_SHA256:TLSv1.3:Kx=any:Au=any:Enc=AESGCM(128):Mac=AEAD) (SMTP-AUTH username dpchrist@holgerdanske.com, mechanism PLAIN) for ; Sat, 15 Apr 2023 14:22:00 -0700 Message-ID: Date: Sat, 15 Apr 2023 14:21:51 -0700 List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: frequent disk error, need guidance To: questions@freebsd.org References: <20230415073315.7adfdddd.freebsd@edvax.de> Content-Language: en-US From: David Christensen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[holgerdanske.com,none]; R_SPF_ALLOW(-0.20)[+a:november.he.net]; R_DKIM_ALLOW(-0.20)[holgerdanske.com:s=nov-20210719-112354]; MIME_GOOD(-0.10)[text/plain]; DKIM_TRACE(0.00)[holgerdanske.com:+]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US]; MLMMJ_DEST(0.00)[questions@freebsd.org]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[questions@freebsd.org]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4PzR8w0vW5z3Kmy X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On 4/15/23 12:25, Gary Aitken wrote: > Thanks all who responded. > Replaced the cable and retried, no change. > Used different port with new cable, no change. > Brought up, tested (smartctl --test=long), set up a new disk. > Having never actually done this (I've always installed a newer version > of fbsd in such cases), wanted to see if the following is a good way > to copy the old disk to the new one. > > mount /dev/ada1p2 /mnt/newsys > cd /mnt/newsys > dump -0 -f - /dev/ada0p2 | restore -r -Dv -f - > > However... this is a running system, which seems unlikely to produce > a consistent result. > > There are only 2 sata slots on the mobo, so I can't mount a third > system, although I might be able to build a memstick and use that. > Can I reboot in a read-only manner and do the above? > Never done that, not sure what's involved. > Is single-user mode sufficient? > > Thanks, > > Gary Okay. So, it sounds like the HDD is failing. I would not attempt to clone the system drive of running OS -- it is a moving target, and I do not have the expertise. If you boot a live drive, I expect dump/ restore of each file system could work. But, you also have to deal with partitioning schemes, partition table(s), slices, partitions, boot loaders, file systems, etc.. AIUI Clonezilla facilitates such, but I am unsure of its FreeBSD support: https://clonezilla.org/ I do imaging/ cloning the KISS way -- I shut down the computer, connect a large HDD, boot a live USB stick, and use dd(1) to copy the system drive blocks 0 through the end of the last slice to an image file on the external HDD. I typically pipe the stream through gzip(1) to reduce storage space and run time. I restore by copying the image file to the system drive or to a replacement drive. I clone by copying the source drive or the image file to a target drive. This process is complete for MBR partitioning. For GPT partitioning, you must account for the backup partition table; the simplest approach is to copy the entire system drive. David