Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I accidentally deleted my /root directory

5 views
Skip to first unread message

MSC-223

unread,
Oct 12, 2022, 3:13:44 AM10/12/22
to
I'm a student learning software engineering and I accidentally deleted my /root directory, is there a way I can recover my lost dir with it's configurations? Please I need help because I can't do my projects without navigating cd /root.

Bobbie Sellers

unread,
Oct 12, 2022, 11:23:43 AM10/12/22
to
On 10/12/22 00:13, MSC-223 wrote:
> I'm a student learning software engineering and I accidentally deleted my /root directory, is there a way I can recover my lost dir with it's configurations? Please I need help because I can't do my projects without navigating cd /root.

Just recalling and wondering what Mandriva you are running.
But If you have the installation media of whatever you can re-install.
If you were backing up the install as everyone should then you can
restore from the backup. I don't know sadly of a current Mandriva
distribution. And stay out of cd / (root) since you seem to know
so little about such matters.
Your /home should have all the configuration data.

You could try to recover with PhotoRec but then you need a drive to
recover your data. The drive should be larger than the / (root) in
case of problems but I think simply re-installing the OS should
work best.
I started using Mandriva in 2006 to 2012 stopping because the 2011
version would not run on my hardware and I could get NO help from
the Mandriva site after spending money to download a single iso file.

bliss - brought to you by the power and ease of PCLinuxOS
the Perfect Computer Linus Operating System(for me),
and a minor case of hypergraphia.
Linux 5.19.14 KDE 5.25.5

--
bliss dash SF 4 ever at dslextreme dot com

William Unruh

unread,
Oct 13, 2022, 7:32:38 AM10/13/22
to
On 2022-10-12, MSC-223 <ssra...@gmail.com> wrote:
> I'm a student learning software engineering and I accidentally deleted my /root directory, is there a way I can recover my lost dir with it's configurations? Please I need help because I can't do my projects without navigating cd /root.

Unless you made a backup, no. But the configuration should be the same
as it was when it was originally created.

Can you log in as a user (or were you doing everything as root?).

Get a Live distribution. -- Mageia, Mandriva, redhat, whatever.
boot intot he live distribution. mount the / partition of your Mandriva
disk somewhere (eg mkdir /mnt/disk;mount /dev/sda5 /mnt/disk (where you
replace /dev/sda5 with your / partition location.)
mkdir /mnt/disk/root
rsync -av /root/ /mnt/disk/root
or
cp -p /root/* /root/.??* /mnt/disk/root
(Note that ?? is crucial. Otherwise you will fill up the /mnt/root with
junk-- in particular, your whole disk will be copied into /root)

NOw you should be able to boot up and su into root.

IF YOU ARE RUNNING REGULARLY AS ROOT, STOP IT. Do everything as a a
user, except things which absolutley need to be done as root, and get
out of root as soon as possible.

0 new messages