This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

Can I save pool ? [SAVED]

Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
User avatar
alexey123
Moderator
Moderator
Posts: 1469
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Can I save pool ? [SAVED]

Post by alexey123 »

I'm work on TheBrig and begin attach zfs option for it

I create zfs on files for do experiment safely

Code: Select all

#!/bin/sh
WORKDIR=`pwd`
for i in 1 2 3 4  
do 
	dd if=/dev/zero of=${WORKDIR}/file${i} bs=100M count=4  
done
zpool create tank ${WORKDIR}/file1 ${WORKDIR}/file2 ${WORKDIR}/file3 ${WORKDIR}/file4 
zpool import -d ${WORKDIR}
I add postinit script for keep experimental pool alive after reboot

Code: Select all

zpool import -d /mnt/disk/afiles tank
Then I managed pool over webgui - all worked , jail's user can manage specified datasets, and user can access to files

But unfortunately I execute command under main (broke root, NOT EXECUTE!!)

Code: Select all

zfs set mountpoint=/ tank/jail/jail1
I successfully restored my test machine, but without my tested pool - when I try to connect it, I lost my NAS.

May I have chance repair mount point for tested pool, or I need delete files and create new ?
( I ask it because I must prevent this faultly command input on TheBrig :!: )
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

User avatar
b0ssman
Forum Moderator
Forum Moderator
Posts: 2438
Joined: 14 Feb 2013 08:34
Location: Munich, Germany
Status: Offline

Re: Can I save pool ?

Post by b0ssman »

the pool should still be there.

can't you just set the mountpoint to the original value?
Nas4Free 11.1.0.4.4517. Supermicro X10SLL-F, 16gb ECC, i3 4130, IBM M1015 with IT firmware. 4x 3tb WD Red, 4x 2TB Samsung F4, both GEOM AES 256 encrypted.

User avatar
daoyama
Developer
Developer
Posts: 394
Joined: 25 Aug 2012 09:28
Location: Japan
Status: Offline

Re: Can I save pool ?

Post by daoyama »

Of course yes, you can import from other booted OS.
Using same version of LiveCD or LiveUSB is recommended but should work latest.

If you can't accsess rootfs, try shutdown by CTRL+ALT+DEL from console.
Or press power button if ACPI is enabled.

1. Booting without ZFS configured OS
2. verify your pool name
# zpool import
3. force import without mounting
# zpool import -f -N poolname
4. check your mountpoint
# zfs get mountpoint
5. correct mountpoint
# zfs set mountpoint=XXXX pool@dataset
6. shutdown and reboot normal way
NAS4Free 10.2.0.2.2115 (x64-embedded), 10.2.0.2.2258 (arm), 10.2.0.2.2258(dom0)
GIGABYTE 5YASV-RH, Celeron E3400 (Dual 2.6GHz), ECC 8GB, Intel ET/CT/82566DM (on-board), ZFS mirror (2TBx2)
ASRock E350M1/USB3, 16GB, Realtek 8111E (on-board), ZFS mirror (2TBx2)
MSI MS-9666, Core i7-860(Quad 2.8GHz/HT), 32GB, Mellanox ConnectX-2 EN/Intel 82578DM (on-board), ZFS mirror (3TBx2+L2ARC/ZIL:SSD128GB)
Develop/test environment:
VirtualBox 512MB VM, ESXi 512MB-8GB VM, Raspberry Pi, Pi2, ODROID-C1

User avatar
alexey123
Moderator
Moderator
Posts: 1469
Joined: 19 Aug 2012 08:22
Location: Israel, Karmiel
Contact:
Status: Offline

Re: Can I save pool ?

Post by alexey123 »

b0ssman wrote:the pool should still be there.
can't you just set the mountpoint to the original value?
I cannot restore mount point because dataset mounted instead root and I not have any command.

Many thanks for Aoyama san.
Command mast type with bold : zpool import -f -N poolname - great!!!!
If you can't accsess rootfs, try shutdown by CTRL+ALT+DEL from console.
Or press power button if ACPI is enabled.
I can pull the power cord also, but need run fsck in single user mode. ACPI always enabled for me , I pressed on power button

Then I connect usb flash to main server and run dmesg for identify his name. It was da1
Then under main server I execute

Code: Select all

mkdir /mnt/flash && mount /dev/da1a /mnt/flash
Then I open and edit with gui editor config.xml file - just remove entry

Code: Select all

zpool import -d /mnt/disk/afiles tank
Umount flash, plug it to tested server and boot it.
then execute great command - zpool import -f -N tank
Correct path and re - insert postinit comand

Code: Select all

zpool import -d /mnt/disk/afiles tank

My TheBrig scripts will work so, that they return the datasets into the same mount point, where jails took them, and additional, scripts will check forbidden paths
Home12.1.0.4 - Ingva (revision 7091)/ x64-embedded on AMD A8-7600 Radeon R7 A88XM-PLUS/ 16G RAM / UPS Ippon Back Power Pro 600
Lab 12.1.0.4 - Ingva (revision 7091) /x64-embedded on Intel(R) Core(TM) i3-3220 CPU @ 3.30GHz / H61M-DS2 / 4G RAM / UPS Ippon Back Power Pro 600

Post Reply

Return to “ZFS (only!)”