Software & Hardware Mix: > Linux / Unix / Android

Recover your /home data with an Ubuntu CD USB Boot Disk from a ZFS partition

(1/1)

devnullius:
I was lucky so I better write it down.

Linux sucks. I'm using Ubuntu 20.04 and it wouldn't boot any longer. Recovery console was too fast to catch so I booted with an installation USB.

Then the question is: how to mount my old hard disk and copy my /home/data to safety!

sudo su -

mkdir /home/myhome
zpool status

sudo zpool import rpool rpoolssd
--> you have to rename rpool to avoid conflicts, or so I think!

zpool status

--- Code: ---Which gives for me:
pool: bpool
 state: ONLINE
  scan: scrub repaired 0B in 0 days 00:00:01 with 0 errors on Sat Aug  7 22:24:03 2021
config:

NAME                                    STATE     READ WRITE CKSUM
bpool                                   ONLINE       0     0     0
  c2124c91-6e47-ff42-85e7-3c1199be6f2b  ONLINE       0     0     0

errors: No known data errors

  pool: rpoolssd
 state: ONLINE
  scan: scrub repaired 0B in 0 days 01:52:25 with 0 errors on Sun Aug  8 00:16:27 2021
config:

NAME                                    STATE     READ WRITE CKSUM
rpoolssd                                ONLINE       0     0     0
  c6576671-0ca6-f14a-9633-088e41e229d4  ONLINE       0     0     0
--- End code ---



zfs list -ro canmount,mountpoint,mounted,name rpoolssd
--> that gives, for me:

--- Code: ---      on  /home/myhome                     no  rpoolssd/USERDATA/myhome_a3k59c
      on  /root                          no  rpoolssd/USERDATA/root_a3k59c
--- End code ---

zfs set mountpoint=legacy rpoolssd

mount -t zfs rpoolssd/USERDATA/myhome_a3k59c /home/myhome

devnullius:
if you make yourself root (sudo su -), you have full rights to all the files. You can remove what you don't need, then make a backup of your freshly mounted zfs /home/myhome mountpoint as follows:

cd /home

--- Code: ---tar -cpzf /media/ubuntu/hdd11/myhome.tar.gz --exclude=*tmp --exclude=myhome.tar.gz --exclude=.cache --exclude=.debug --exclude=.dbus --exclude=.gvfs --exclude=.local/share/gvfs-metadata --exclude=.local/share/Trash --exclude=.recently-used --exclude=.thumbnails --exclude=.xsession-errors --exclude=.Trash --exclude=.steam --exclude=Downloads --exclude=GitHub --exclude=Public --exclude=Steam --exclude=Templates --exclude="VirtualBox VMs" --warning=no-file-changed ./myhome/

--- End code ---

With /media/ubuntu/hdd11 a disk I mounted with gnome's disks app.

Hoa Dao:
Your article is very good and useful, thank you for sharing, mig8 hopes that next time you will have more good articles to send to all readers.

Navigation

[0] Message Index

Reply

Go to full version