From nobody Sat Apr 16 15:46:56 2022 X-Original-To: freebsd-current@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 D41427EE391 for ; Sat, 16 Apr 2022 15:47:09 +0000 (UTC) (envelope-from bakul@iitbombay.org) Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KgcyN65JMz3qdq for ; Sat, 16 Apr 2022 15:47:05 +0000 (UTC) (envelope-from bakul@iitbombay.org) Received: by mail-oi1-x22e.google.com with SMTP id r8so10892248oib.5 for ; Sat, 16 Apr 2022 08:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iitbombay-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=X550gt2svAHqXdK1OlGVTaVJl3hPueK3cvU/qS808pI=; b=xtTm/5etw2WWJxs5hzfJqHrUx+Y9P3pGz8nWmDXkazdFEUetYv3+ZBl+sL+j6kb/sm R4Q8MJ69EhuO8+Vwv0/1ubrJD4HgL0GcIdtPyEOCjvA5Y7bH8qIGXuNct3SdjEZalEcZ r7Znxo+mPxmNssWjFXuidsNjRaNjQRvvhYrgxAOgPtWvWs0ROWV8A/h9odGJbwlVUXQE oUgJowPSCD60q9WzH17DoBLgUMwH/Gbfam3UK0ZFuG7kxQH8c4PSVTeW/Ka2FnQp/Z1j ckNtzZt7TbG9RRvK6z9gSUGn3WliYj3h0HxAXlI8nQqF3Lr0Gt6yBCDNqhzfIzxYBT22 lemw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=X550gt2svAHqXdK1OlGVTaVJl3hPueK3cvU/qS808pI=; b=ais+MIJukIV4k+TGqov1wUDV/71llhwJ4KVpa68gi8Uypef3w6eMFboRqXovImwfmX JQsar2BmTC60w8vcF91zx/R9mAeL2k9oryk48zlp4+4OAsgvotWYsnk7kJcqIBgD+uA9 HpwhUgOZriATsvEIs3oW5j9vJ/bX7qxDEQBjlAPBbpM+qkiG8Un1JJ5liJWnBRGxrzrr cRxofIbAVqo6YhEHXLtiRxluCLagmTQhhn/DkzbI2Wa1raWaeiNTT0RNfyS9AXFpycWc xl3Bpf/gOkhEr5D+LYus1SwRb3ATS3ri8pC9OMjFET7+GVem0qUuQzxiXeWcdqHv95B8 xnGQ== X-Gm-Message-State: AOAM533QuTonziH1m70uaV72NAoZhtjJ7IXpigek05PZygMSyw+eaZHG 7dKjqyFcKoRSHwEdDLZxtTzNp3NYfxnp1A== X-Google-Smtp-Source: ABdhPJwvUiirmIXuZ/u8Tb1q7IZfCr7UgyhRGPHvYh/HjkSIL4TFcxtHoG772q8hb1r+gFEOcUposQ== X-Received: by 2002:a54:488a:0:b0:2ec:f48f:8eea with SMTP id r10-20020a54488a000000b002ecf48f8eeamr3595293oic.166.1650124018757; Sat, 16 Apr 2022 08:46:58 -0700 (PDT) Received: from smtpclient.apple (107-215-223-229.lightspeed.sntcca.sbcglobal.net. [107.215.223.229]) by smtp.gmail.com with ESMTPSA id 64-20020aca0643000000b002f9b8a6ca98sm2213563oig.4.2022.04.16.08.46.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 16 Apr 2022 08:46:58 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-EF26BDCC-F50B-46E4-8B26-1D7A40357380 Content-Transfer-Encoding: 7bit From: Bakul Shah List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 (1.0) Subject: Re: recover deleted file Date: Sat, 16 Apr 2022 08:46:56 -0700 Message-Id: <07AF4B92-2BA2-43AC-8D60-52D299584C14@iitbombay.org> References: Cc: "Julian H. Stacey" , FreeBSD Current In-Reply-To: To: Sami Halabi X-Mailer: iPad Mail (19E258) X-Rspamd-Queue-Id: 4KgcyN65JMz3qdq X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=iitbombay-org.20210112.gappssmtp.com header.s=20210112 header.b="xtTm/5et"; dmarc=none; spf=pass (mx1.freebsd.org: domain of bakul@iitbombay.org designates 2607:f8b0:4864:20::22e as permitted sender) smtp.mailfrom=bakul@iitbombay.org X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[iitbombay-org.20210112.gappssmtp.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FREEMAIL_TO(0.00)[gmail.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998]; R_DKIM_ALLOW(-0.20)[iitbombay-org.20210112.gappssmtp.com:s=20210112]; FREEFALL_USER(0.00)[bakul]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-0.999]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[iitbombay.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::22e:from]; MLMMJ_DEST(0.00)[FreeBSD-current]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N --Apple-Mail-EF26BDCC-F50B-46E4-8B26-1D7A40357380 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable This may help? I=E2=80=99ve no experience with it, I just googled it for you= . The comp.sources.misc usenet group in volume 17 issue 23 (in 1991) has an u= ndelete program that supposedly works with 4.3BSD =E2=80=94 probably won=E2=80= =99t work with FreeBSD=E2=80=99s version but if you=E2=80=99re desperate it c= ould be a starting point. https://www.ufsexplorer.com/solutions/recover-deleted-files-bsd.php Since you asked for advice, this may just be the nature=E2=80=99s way of tel= ling you you really didn=E2=80=99t need the file. It can be a very =E2=80=9C= free=E2=80=9Ding experience :-) > On Apr 16, 2022, at 8:03 AM, Sami Halabi wrote: >=20 > =EF=BB=BF > okay... > all seems very time consuming operations!! >=20 > There should be an os "undelete" as happens in NTFS for example.. which is= very fast and can be done also with extra tools without a hassle. >=20 > for now I got backup from last day .. caused me a lot of troubles, not say= legal ones, but I passed the point to hold the machine down. >=20 > any advice? >=20 > Maybe UFS developer would do a rework so latest deleted inodes would put i= n a "recycle bin" (maybe with a sysctl or whatever) for say one day (or any o= ther configurable sysctl) and allow to recover quickly or "force delete / em= pty recycle bin" , rather than delete and give back space immediately for us= e and destroy possibility to restore. >=20 > my 2 cents. >=20 > Sami >=20 >=20 >=20 >> On Sat, Apr 16, 2022 at 5:23 PM Julian H. Stacey wrote:= >> > Then I would reboot single user,=20 >> > fsck & mount only the partitions the data was Not on., >> > dd the partition to recover, >> > then fsck the partition & mount it, & go multi user, >> > then I'd make a 2nd copy of the partition with data to recover >>=20 >> Oops. I meant: >>=20 >> ...... I'd make a 2nd copy (with cp) from the 1st image file, >> not of course Not a copy of raw decice partition after fsck >> has discarded blocks. >>=20 >> The spare 2nd. copy because I've zapped data too often, trying to rescue >> it, while fumbling with unfamiliar resue tools: its easier to >> have a play image one can experimentaly try to recover from, & >> periodicaly while one learns, & that gets in a mess, one can refresh >> copy from master to experimental copy. >>=20 >> If any recovery tools want to run on devices, & refuse images in files, u= se >> mdconfig -a -t vnode -f imagefile >>=20 >> I recall FS has journals etc,=20 >> Specalists on list fs@ >>=20 >> Cheers, >> --=20 >> Julian Stacey http://berklix.com/jhs/ http://StolenVotes.UK =20 >> Kill / remove Putin to stop him killing & provoking world war. >=20 >=20 > --=20 > Sami Halabi > Information Systems Engineer > NMS Projects Expert, FreeBSD SysAdmin Expert > Asterisk Expert --Apple-Mail-EF26BDCC-F50B-46E4-8B26-1D7A40357380 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
Thi= s may help? I=E2=80=99ve no experience with it, I just googled it for you. T= he comp.sources.misc usenet group in volume 17 issue 23 (in 1991) has an und= elete program that supposedly works with 4.3BSD =E2=80=94 probably won=E2=80= =99t work with FreeBSD=E2=80=99s version but if you=E2=80=99re desperate it c= ould be a starting point.

Since you asked for advice, this may just be the nature= =E2=80=99s way of telling you you really didn=E2=80=99t need the file. It ca= n be a very =E2=80=9Cfree=E2=80=9Ding experience :-)
<= br>
On Apr 16, 2022, at 8:03 AM, Sami Halabi <so= dynet1@gmail.com> wrote:

=EF=BB=BF
okay...
all se= ems very time consuming operations!!

There should b= e an os "undelete" as happens in NTFS for example.. which is very fast a= nd can be done also with extra tools without a hassle.

<= div>for now I got backup from last day .. caused me a lot of troubles, not s= ay legal ones, but I passed the point to hold the machine down.
any advice?

Maybe UFS developer would d= o a rework so latest deleted inodes would put in a "recycle bin" (maybe with= a sysctl or whatever) for say one day (or any other configurable sysctl) an= d allow to recover quickly or "force delete / empty recycle bin" , rather&nb= sp;than delete and give back space immediately for use and destroy poss= ibility to restore.

my 2 cents.

Sami



On Sat, Apr 16, 2022 at 5:23 PM= Julian H. Stacey <jhs@berklix.com= > wrote:
> T= hen I would reboot single user,
> fsck & mount only the partitions the data was Not on.,
> dd the partition to recover,
> then fsck the partition & mount it, & go multi user,
> then I'd make a 2nd copy of the partition with data to recover

Oops. I meant:

...... I'd make a 2nd copy (with cp) from the 1st image file,
       not of course Not a copy of raw decice partition a= fter fsck
       has discarded blocks.

The spare 2nd. copy because I've zapped data too often, trying to rescue
= it, while fumbling with unfamiliar resue tools: its easier to
have a play image one can experimentaly try to recover from, &
periodicaly while one learns, & that gets in a mess,  one can refre= sh
copy from master to experimental copy.

If any recovery tools want to run on devices, & refuse images in files, u= se
        mdconfig -a -t vnode -f imagefile

I recall FS has journals etc,
Specalists on list fs@

Cheers,
--
Julian Stacey  http://berklix.com/jhs/ http://StolenVotes.UK 
= Kill / remove Putin to stop him killing & provoking world war.


--
Sami Halabi<= div>Information Systems Engineer
NMS Projects Expert, FreeBSD SysAdmin Expert
Asterisk E= xpert
= --Apple-Mail-EF26BDCC-F50B-46E4-8B26-1D7A40357380--