Solved How can I group two or more hard drives to create a single large volume ?

Then just read the chapter you are interested in. Even there it is fine just to read a few sections of a chapter that apply to a certain issue or topic.

I don't know what's the chapter that I'm interested. To know what is this,I need to ask some questions before,to circumscribe the argument. If I understand by myself what's the chapter,I need to know which section of the chapter I need to read. If I understand by myself what's the section,I need to know which sub-section I need to read. It depends about the complexity. Did u get the point ? In a few words,I need to reduce the complexity thanks to your suggestions until the point that I can study something with a decent amount of effort and at the same time I can enjoy it.
 
Based on all your threads I think you want a lot at the same time, and not just basic stuff. This makes it not easier. I wish you succeed. One day I can benefit from your knowledge you have build up :beer: :).
 
I've just won a trophy : Addicted (1000 messages sent). Just because I'm lazy :D. You all,everyone won the same trophy,anyway. Without your valuable help I couldn't have. This place is so comfortable that it gives me the motivation to ask,read and expose bugs. I didn't find the same quality on the various Linux forums. I have been helped a lot , but without the same feeling of being comfortable, Here it's like to be at "home". FreeBSD as OS is like my "home". I never thought it liked to me so much more than Linux.
 
I'm trying to understand how to modify the file fstab stored on the folder /etc in my FreeBSD 13R installed on a ZFS file system. Below you can read what I tried to do,but I haven't been able to get the access into the folder /etc. Simply it is not displayed even if I have tried to set the canmount parameter to on. I need to edit the fstab file because inside of it I have added a wrong parameter. When I issue the commands below I'm on another FreeBSD installation which uses the UFS2 file system. The disk where I have installed FreeBSD on a ZFS fs is mapped as ada0 and ada0p4 is the root partition :

Code:
mario@marietto:/usr/home/marietto/bhyve # gpart show

=>       40  976773088  ada0  GPT  (466G)
         40     532480     1  efi  (260M)
     532520       1024     2  freebsd-boot  (512K)
     533544        984        - free -  (492K)
     534528    4194304     3  freebsd-swap  (2.0G)
    4728832  972044288     4  freebsd-zfs  (464G)
  976773120          8        - free -  (4.0K)

mario@marietto:/usr/home/marietto/bhyve # zpool import

   pool: zroot
     id: 17047367030737245538
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

        zroot       ONLINE
        ada0p4    ONLINE

mario@marietto:/usr/home/marietto/bhyve # zpool import -fR /mnt/zroot zroot

mario@marietto:/usr/home/marietto/bhyve # zpool list


NAME    SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
zroot   460G   181G   279G        -         -     1%    39%  1.00x    ONLINE  /mnt/zroot


mario@marietto:/usr/home/marietto/bhyve # zfs get canmount


NAME                PROPERTY  VALUE     SOURCE
zroot               canmount  on        local
zroot/ROOT          canmount  on        local
zroot/ROOT/default  canmount  noauto    local
zroot/tmp           canmount  on        default
zroot/usr           canmount  off       local
zroot/usr/home      canmount  on        default
zroot/usr/ports     canmount  on        default
zroot/usr/src       canmount  on        default
zroot/var           canmount  off       local
zroot/var/audit     canmount  on        default
zroot/var/crash     canmount  on        default
zroot/var/log       canmount  on        default
zroot/var/mail      canmount  on        default
zroot/var/tmp       canmount  on        default


mario@marietto:/usr/home/marietto/bhyve # zfs set canmount=on zroot/ROOT/default


mario@marietto:/usr/home/marietto/bhyve # zfs get canmount


NAME                PROPERTY  VALUE     SOURCE
zroot               canmount  on        local
zroot/ROOT          canmount  on        local
zroot/ROOT/default  canmount  on        local
zroot/tmp           canmount  on        default
zroot/usr           canmount  off       local
zroot/usr/home      canmount  on        default
zroot/usr/ports     canmount  on        default
zroot/usr/src       canmount  on        default
zroot/var           canmount  off       local
zroot/var/audit     canmount  on        default
zroot/var/crash     canmount  on        default
zroot/var/log       canmount  on        default
zroot/var/mail      canmount  on        default
zroot/var/tmp       canmount  on        default

mario@marietto:/usr/home/marietto/bhyve # ls /mnt/zroot
tmp     usr     var     zroot
 

mario@marietto:/usr/home/marietto/bhyve # zpool import -fR /mnt/zroot zroot

Normally, there's no need for force.

(If ever you are prompted, by the system, to use force when importing, then ask yourself: Was the prior shutdown of the operating system clean; did an export occur?)


mario@marietto:/usr/home/marietto/bhyve # zfs set canmount=on zroot/ROOT/default

Without delay, please revert that change.

(If forgotten, there's a risk of interference with normal behaviours of boot environments.)

Instead:
  1. use zpool-get(8) to get the bootfs property of the pool
  2. this identifies the default bootable dataset for the root pool – in other words, the boot environment that probably includes the required /etc directory
  3. in the altroot context, mount the file system that includes the required environment
  4. when you have finished with the pool, remember to export.
Code:
% zpool list
NAME     SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
august   912G   659G   253G        -         -    34%    72%  1.00x    ONLINE  -
% zpool import
cannot discover pools: permission denied
% sudo zpool import
grahamperrin's password:
   pool: freecom
     id: 13595475975699632990
  state: ONLINE
status: Some supported features are not enabled on the pool.
        (Note that they may be intentionally disabled if the
        'compatibility' property is set.)
 action: The pool can be imported using its name or numeric identifier, though
        some features will not be available without an explicit 'zpool upgrade'.
 config:

        freecom     ONLINE
          gpt/zfs0  ONLINE
% mkdir /tmp/freecom
% sudo zpool import -f -R /tmp/freecom 13595475975699632990
% zfs list freecom
NAME      USED  AVAIL  REFER  MOUNTPOINT
freecom  68.1G   141G    96K  /tmp/freecom/d31121
% zpool get bootfs freecom
NAME     PROPERTY  VALUE   SOURCE
freecom  bootfs    freecom/ROOT/n253657-080b4e8a0c-a  local
% zfs get canmount,mountpoint | grep freecom/ROOT/ | grep -v \@
freecom/ROOT/default                                     canmount    noauto      local
freecom/ROOT/default                                     mountpoint  /tmp/freecom  local
freecom/ROOT/n2-f4e67f18b-a                              canmount    noauto      local
freecom/ROOT/n2-f4e67f18b-a                              mountpoint  /tmp/freecom  local
freecom/ROOT/n2-f4e67f18b-b                              canmount    noauto      local
freecom/ROOT/n2-f4e67f18b-b                              mountpoint  /tmp/freecom  local
freecom/ROOT/n253657-080b4e8a0c-a                        canmount    noauto      local
freecom/ROOT/n253657-080b4e8a0c-a                        mountpoint  /tmp/freecom  local
freecom/ROOT/n4390-e92ffd9b626-a                         canmount    noauto      local
freecom/ROOT/n4390-e92ffd9b626-a                         mountpoint  /tmp/freecom  local
freecom/ROOT/n494-d4da692862f19-a                        canmount    noauto      local
freecom/ROOT/n494-d4da692862f19-a                        mountpoint  /tmp/freecom  local
% sudo zfs mount freecom/ROOT/n253657-080b4e8a0c-a
% find -s /tmp/freecom/etc -type d -maxdepth 1
/tmp/freecom/etc
/tmp/freecom/etc/authpf
/tmp/freecom/etc/autofs
/tmp/freecom/etc/bluetooth
/tmp/freecom/etc/cron.d
/tmp/freecom/etc/defaults
/tmp/freecom/etc/devd
/tmp/freecom/etc/dma
/tmp/freecom/etc/gss
/tmp/freecom/etc/jail.conf.d
/tmp/freecom/etc/kyua
/tmp/freecom/etc/mail
/tmp/freecom/etc/mtree
/tmp/freecom/etc/newsyslog.conf.d
/tmp/freecom/etc/ntp
/tmp/freecom/etc/pam.d
/tmp/freecom/etc/periodic
/tmp/freecom/etc/pkg
/tmp/freecom/etc/ppp
/tmp/freecom/etc/rc.conf.d
/tmp/freecom/etc/rc.d
/tmp/freecom/etc/security
/tmp/freecom/etc/ssh
/tmp/freecom/etc/ssl
/tmp/freecom/etc/syslog.d
/tmp/freecom/etc/X11
/tmp/freecom/etc/zfs
% file /tmp/freecom/etc/fstab
/tmp/freecom/etc/fstab: ASCII text
% sudo zpool export 13595475975699632990
cannot open '13595475975699632990': name must begin with a letter
% sudo zpool export freecom
% sudo zpool import
   pool: freecom
     id: 13595475975699632990
  state: ONLINE
status: Some supported features are not enabled on the pool.
        (Note that they may be intentionally disabled if the
        'compatibility' property is set.)
 action: The pool can be imported using its name or numeric identifier, though
        some features will not be available without an explicit 'zpool upgrade'.
 config:

        freecom     ONLINE
          gpt/zfs0  ONLINE
%

zpool-get.8 — OpenZFS documentation

zpoolprops.7 — OpenZFS documentation



Postscript

Cross-reference: How to mount the /etc folder from a FreeBSD installation stored on another disk / partition with the the ZFS fs.
 
Hint

… need to edit the fstab …

After you correct the file (assuming that you'll fix it today, 24th March):
  1. boot
  2. as root (without starting an X session)
  3. bectl rename default 2022-03-24-a
  4. bectl create 2022-03-24-b && bectl activate 2022-03-24-b && shutdown -r now
Rationale

The name default, given to the boot environment by the installer for FreeBSD, is ambiguous. There's potential for confusion if the default becomes something other than default.

Choose, for yourself, a boot environment naming convention that will be meaningful as time passes. Imagine using the OS more than one year from now.

Instead of 2022-03-24-a you might prefer 2022-03-24-fstab-fixed.

I like the orderly -a -b -c ⋯ approach because it's least likely to annoy me if ever I need to choose in the loader menu.

(The loader menu can not present a list of boot environments.)
 
This is what I did :

Code:
# zpool import

   pool: zroot
     id: 3547020836659149114
  state: FAULTED
status: One or more devices contains corrupted data.
 action: The pool cannot be imported due to damaged devices or data.
        The pool may be active on another system, but can be imported using
        the '-f' flag.
   see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-5E
 config:

        zroot                       FAULTED  corrupted data
          diskid/DISK-20140100006C  UNAVAIL  corrupted data

   pool: zroot
     id: 17047367030737245538
  state: ONLINE
 action: The pool can be imported using its name or numeric identifier.
 config:

        zroot       ONLINE
          ada0p4    ONLINE

# zpool import -f -R /mnt/zroot 17047367030737245538
# zfs list zroot

NAME    USED  AVAIL     REFER  MOUNTPOINT
zroot   181G   264G       96K  /mnt/zroot/zroot

# zpool get bootfs zroot

NAME   PROPERTY  VALUE               SOURCE
zroot  bootfs    zroot/ROOT/default  local

# zfs mount zroot/ROOT/default

cannot mount 'zroot/ROOT/default': filesystem already mounted

# find -s /mnt/zroot/etc -type d -maxdepth 1

/mnt/zroot/etc
/mnt/zroot/etc/X11
/mnt/zroot/etc/authpf
/mnt/zroot/etc/autofs
/mnt/zroot/etc/bluetooth
/mnt/zroot/etc/cron.d
/mnt/zroot/etc/defaults
/mnt/zroot/etc/devd
/mnt/zroot/etc/dma
/mnt/zroot/etc/gss
/mnt/zroot/etc/kyua
/mnt/zroot/etc/mail
/mnt/zroot/etc/mtree
/mnt/zroot/etc/newsyslog.conf.d
/mnt/zroot/etc/ntp
/mnt/zroot/etc/pam.d
/mnt/zroot/etc/periodic
/mnt/zroot/etc/pkg
/mnt/zroot/etc/ppp
/mnt/zroot/etc/rc.conf.d
/mnt/zroot/etc/rc.d
/mnt/zroot/etc/security
/mnt/zroot/etc/ssh
/mnt/zroot/etc/ssl
/mnt/zroot/etc/syslog.d
/mnt/zroot/etc/zfs

this is the error that I've fixed : I've commented this line :
Code:
#/dev/ada0p4    /                       zfs             rw                      1       1

Code:
nano /mnt/zroot/etc/fstab/



# Device        Mountpoint              FStype          Options                 Dump    Pass#

#/dev/ada0p4    /                       zfs             rw                      1       1
/dev/ada0p1     /boot/efi               msdosfs         rw                      2       2
/dev/ada0p3     none                    swap            sw                      0       0


#linux


tmpfs           /tmp                    tmpfs           rw,mode=1777            0       0
procfs          /proc                   procfs          rw,late                 0       0
fdescfs         /dev/fd                 fdescfs         rw,late                 0       0
linprocfs       /compat/linux/proc      linprocfs       rw,late                 0       0
linsysfs        /compat/linux/sys       linsysfs        rw,late                 0       0
devfs           /compat/linux/dev       devfs           rw,late                 0       0
fdescfs         /compat/linux/dev/fd    fdescfs         rw,late,linrdlnk        0       0
tmpfs           /compat/linux/dev/shm   tmpfs           rw,late,mode=1777       0       0
/home           /compat/linux/home      nullfs          rw,late                 0       0
/tmp            /compat/linux/tmp       nullfs          rw,late                 0       0

so,is this fstab file good for booting freebsd ? because it won't boot :

index.jpg
 
If the mountpoint value for zroot/tmp is /tmp then change its canmount value to off.

Logically: if you want tmpfs for /tmp then you do not also want a different type of file system at the same mount point.

Also, tmpfs for /tmp can be generally useful (not #linux-specific).
 
Do u mean to remove this disk ?

Code:
diskid/DISK-20140100006C  UNAVAIL  corrupted data

or this ?

Code:
=>        40  3907029094  da3  GPT  (1.8T)
          40      532480    1  efi  (260M)
      532520  3898073080    2  freebsd-ufs  (1.8T)
  3898605600     8388608    3  freebsd-swap  (4.0G)
  3906994208       34926       - free -  (17M)

=>        40  3907029094  diskid/DISK-NM13N4CZ  GPT  (1.8T)
          40      532480                     1  efi  (260M)
      532520  3898073080                     2  freebsd-ufs  (1.8T)
  3898605600     8388608                     3  freebsd-swap  (4.0G)
  3906994208       34926                        - free -  (17M)

Geom name: da3
Providers:
1. Name: da3
Mediasize: 2000398933504 (1.8T)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r0w0e0
descr: Seagate M3 Portable
lunname: NM13N4CZ
lunid: 3e4d31334e34435a
ident: NM13N4CZ
rotationrate: unknown
fwsectors: 63
fwheads: 255

why da3 ?

I don't understand why it says "corrupted data". It detects the disk da0 as formatted with ZFS,but it isn't :

Code:
Geom name: da0
Providers:
1. Name: da0
Mediasize: 320072933376 (298G)
Sectorsize: 512
Mode: r0w0e0
descr: SAMSUNG HM320JI
lunid: 5000000000000001
ident: 20140100006C
rotationrate: unknown
fwsectors: 63
fwheads: 255

# gpart show

=>       40  625142368  da0  GPT  (298G)
         40     532480    1  efi  (260M)
532520  616030208    2  freebsd-ufs  (294G)
616562728    8388608    3  freebsd-swap  (4.0G)
624951336     191072       - free -  (93M)

=>       40  625142368  diskid/DISK-20140100006C  GPT  (298G)
40     532480                         1  efi  (260M)
532520  616030208                         2  freebsd-ufs  (294G)
616562728    8388608                         3  freebsd-swap  (4.0G)
624951336     191072                            - free -  (93M)
 
let's see what happens with this :

Code:
# zfs set canmount=off zroot/tmp

# zfs get canmount zroot/tmp 


NAME       PROPERTY  VALUE     SOURCE
zroot/tmp  canmount  off       local
 
Hint



After you correct the file (assuming that you'll fix it today, 24th March):
  1. boot
  2. as root (without starting an X session)
  3. bectl rename default 2022-03-24-a
  4. bectl create 2022-03-24-b && bectl activate 2022-03-24-b && shutdown -r now
Rationale

The name default, given to the boot environment by the installer for FreeBSD, is ambiguous. There's potential for confusion if the default becomes something other than default.

Choose, for yourself, a boot environment naming convention that will be meaningful as time passes. Imagine using the OS more than one year from now.

Instead of 2022-03-24-a you might prefer 2022-03-24-fstab-fixed.

I like the orderly -a -b -c ⋯ approach because it's least likely to annoy me if ever I need to choose in the loader menu.

(The loader menu can not present a list of boot environments.)

how can I destroy and/or deactivate a snapshot ? thanks.
 
Let's say the two ssd disks are /dev/ada1 and /dev/ada2.
You just have to do something like:
Code:
gpart create -s GPT ada1
gpart create -s GPT ada2
gpart add -l ssd1 -t freebsd-zfs ada1
gpart add -l ssd2 -t freebsd-zfs ada2
zpool create myzpool /dev/gpt/ssd1 /dev/gpt/ssd2
zfs create myzpool/myzfs

My first steps with ZFS,please be patient :D ; Let's say that I want to group disk ada0 with disk ada1 :

Code:
=>       40  976773088  ada0  GPT  (466G)

         40     532480     1  efi  (260M)
     532520       1024     2  freebsd-boot  (512K)
     533544        984        - free -  (492K)
     534528    4194304     3  freebsd-swap  (2.0G)
    4728832  972044288     4  freebsd-zfs  (464G)
  976773120          8        - free -  (4.0K)


=>       34  976773101  ada1  GPT  (466G)

         34       2014        - free -  (1.0M)
       2048     262144     1  efi  (128M)
     264192  976508928     2  dragonfly-label64  (466G)
976773120 15 - free - (7.5K)

as u can see,on ada0 I have installed FreeBSD on ZFS and I don't want to destroy it. But It's ok to destroy ada1,since I'm not interested in DragonflyBSD anymore. So,I have issued the following commands :

Code:
gpart destroy -F ada1
gpart create -s GPT ada1
gpart add -t freebsd-zfs -a 4k -s 460g ada1
gpart modify -l disk1 -i 1 ada1

the next command probably could be :

Code:
zpool create myzpool /dev/gpt/ssd1 /dev/gpt/ssd2

but I'm not sure what's the labels of the disk ada0. The label of the disk ada1 should be "disk1" because I've chosen this label before.

The label of the disk ada0 is gptboot0 ? is it correct ?

Code:
# ls /dev/gpt/gptboot0
/dev/gpt/gptboot0

so. To add the disk "ada0" with the disk "ada1" the command to issue is this :

Code:
zpool create myzpool /dev/gpt/gptboot0 /dev/gpt/disk1
?

I would like to go inside the folder /dev/gpt of the disk "ada1" but I don't know how.
 
You need to define what you mean by "group disk ada0 with disk ada1".

A mirror would be common. A stripe (adding a new VDEV to your existing pool, without redundancy) would be possible.

Anything else would probably require starting from scratch.

Don't proceed without advice, as some things you suggest above can damage your existing system on ada0.

To see what labels are where, show us the output of:
Code:
sudo gpart list
We also need to see the existing pool(s):
Code:
zpool status
 
You need to define what you mean by "group disk ada0 with disk ada1".

A mirror would be common. A stripe (adding a new VDEV to your existing pool, without redundancy) would be possible.

Anything else would probably require starting from scratch.

Don't proceed without advice, as some things you suggest above can damage your existing system on ada0.

To see what labels are where, show us the output of:
Code:
sudo gpart list
We also need to see the existing pool(s):
Code:
zpool status

Code:
# gpart list

Geom name: ada0
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 976773127
first: 40
entries: 128
scheme: GPT

Providers:

1. Name: ada0p1
Mediasize: 272629760 (260M)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r1w1e1
efimedia: HD(1,GPT,c4e43424-ae72-11ec-9419-e0d55ee21f22,0x28,0x82000)
rawuuid: c4e43424-ae72-11ec-9419-e0d55ee21f22
rawtype: c12a7328-f81f-11d2-ba4b-00a0c93ec93b
label: efiboot0
length: 272629760
offset: 20480
type: efi
index: 1
end: 532519
start: 40

2. Name: ada0p2

   Mediasize: 524288 (512K)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r0w0e0
efimedia: HD(2,GPT,c4f320d2-ae72-11ec-9419-e0d55ee21f22,0x82028,0x400)
rawuuid: c4f320d2-ae72-11ec-9419-e0d55ee21f22
rawtype: 83bd6b9d-7f41-11dc-be0b-001560b84f0f
label: gptboot0
length: 524288
offset: 272650240
type: freebsd-boot
index: 2
end: 533543
start: 532520

3. Name: ada0p3

   Mediasize: 2147483648 (2.0G)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r1w1e0
efimedia: HD(3,GPT,c509101d-ae72-11ec-9419-e0d55ee21f22,0x82800,0x400000)
rawuuid: c509101d-ae72-11ec-9419-e0d55ee21f22
rawtype: 516e7cb5-6ecf-11d6-8ff8-00022d09712b
label: swap0
length: 2147483648
offset: 273678336
type: freebsd-swap
index: 3
end: 4728831
start: 534528

4. Name: ada0p4

   Mediasize: 497686675456 (464G)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r1w1e1
efimedia: HD(4,GPT,c51a16d5-ae72-11ec-9419-e0d55ee21f22,0x482800,0x39f03800)
rawuuid: c51a16d5-ae72-11ec-9419-e0d55ee21f22
rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
label: zfs0
length: 497686675456
offset: 2421161984
type: freebsd-zfs
index: 4
end: 976773119
start: 4728832

Consumers:

1. Name: ada0
Mediasize: 500107862016 (466G)
Sectorsize: 512
Stripesize: 4096
Stripeoffset: 0
Mode: r3w3e5

Geom name: ada1
modified: false
state: OK
fwheads: 16
fwsectors: 63
last: 976773127
first: 40
entries: 128
scheme: GPT

Providers:

1. Name: ada1p1
Mediasize: 493921239040 (460G)
Sectorsize: 512
Stripesize: 0
Stripeoffset: 20480
Mode: r0w0e0
efimedia: HD(1,GPT,89ba1924-b147-11ec-9318-e0d55ee21f22,0x28,0x39800000)
rawuuid: 89ba1924-b147-11ec-9318-e0d55ee21f22
rawtype: 516e7cba-6ecf-11d6-8ff8-00022d09712b
label: disk1
length: 493921239040
offset: 20480
type: freebsd-zfs
index: 1
end: 964689959
start: 40

Consumers:

1. Name: ada1
Mediasize: 500107862016 (466G)
Sectorsize: 512
Mode: r0w0e0

# zpool status

  pool: zroot
state: ONLINE
config:

NAME        STATE     READ WRITE CKSUM
zroot       ONLINE       0     0     0
ada0p4    ONLINE       0     0     0

errors: No known data errors
 
Back
Top