Other save my NAS

Hello,
I use FreeBSD 11.1 on a 64bits Intel architecture, I chose to take an AMD64 distribution.
Gnome 3 works fine, I fully compiled it.
I would like to save my networked NAS on a USB hard drive of the same capacity,
2 tera maximum, my USB hard drive is connected to my workstation,
so I access my NAS, since the file manager I see both units.
I have a question :
1 / how to mount is format my USB hard drive?
1.2 / which format to choose ZFS or UFS?

Regards
Philippe
 
so I access my NAS, since the file manager I see both units.
Does that mean that your USB hard drive is already formatted? May be it is prepared for Windows?
1 / how to mount is format my USB hard drive?
1.2 / which format to choose ZFS or UFS?
The way how to mount and how to format depends on the file system. If the backup device is a single USB drive you can improve safety by using more than one copy per file with ZFS. On the other hand you never know if it helps if the drive dies. I recommend to use the file system you are familiar with. Only then you can ensure to be able to recover the data. In parallel it might sense to copy the md5 or whatever checksum of the files somewhere to verify the integrity of the data.
 
It's not clear to me what you want to do...

Is it you want to backup/sync the data from your NAS via network to a usb-harddrive connetcted to your FreeBSD workstation?

If that's the case, I'd go for UFS with softupdates and journaling enable. ZFS works too, but does not make sense for a single drive IMO.
Before you create a new layout and filesystem, doublecheck with gpart show or # camcontrol devlist that
/dev/da0 is the right drive! All data on the USB drive will be destroyed if there is something on it!!!
Code:
# gpart destroy -F da0
# gpart create -s gpt da0
# gpart add -t freebsd-ufs -l external-2tb-hdd da0
# newfs -jU /dev/da0p1
Then you mount it by # mount /dev/da0p1 /mnt
 
i try K. Jacker
here is finally a good answer, so I will use UFS, here are some parameters:
gpart show :
Code:
=>        34  3907029101  da0  GPT  (1.8T)
          34        2014       - free -  (1.0M)
        2048  3907026944    1  linux-data  (1.8T)
  3907028992         143       - free -  (72K)

can i to try your sample K. Jacker
Code:
# gpart destroy -F da0
# gpart create -s gpt da0
# gpart add -t freebsd-ufs -l external-2tb-hdd da0
# newfs -jU /dev/da0p1

Then you mount it by # mount /dev/da0p1 /mnt

I think is a good idea but tell me what you think
 
Looks like 2TB drive and no other usb drives connected, so /dev/da0 is right.

There is some linux stuff on that drive, are you sure you don't need that anymore?
If not, then just run the commands I gave you.
 
with the command newfs -jU /dev/da0p1 i have this error :
Code:
 3876211712, 3877493952, 3878776192, 3880058432, 3881340672, 3882622912,
 3883905152, 3885187392, 3886469632, 3887751872, 3889034112, 3890316352,
 3891598592, 3892880832, 3894163072, 3895445312, 3896727552, 3898009792,
 3899292032, 3900574272, 3901856512, 3903138752, 3904420992, 3905703232,
 3906985472
Using inode 4 in cg 0 for 33554432 byte journal
newfs: Failed to initialize new block: Operation not permitted
newfs: soft updates journaling can not be enabled
newfs: /dev/da0p1: failed to write superblock
root@sta-eliote:/usr/home/phipo # mount /dev/da0p1 /mnt
mount: /dev/da0p1: Operation not permitted
root@sta-eliote:/usr/home/phipo #
 
Weird, never seen such an error, I would at first think of a bad block, but I'm not sure...
Is this an old harddisk?

Has the disk been automounted by your filemanager during the process of creating the new filesystem?
1. Please check with mount that /dev/da0p1 isn't mounted.
2. Post output from gpart show da0
3. Post output from tunefs -p /dev/da0p1

You could also try to repeat the steps, but after the gpart destroy -F da0 command, run dd if=/dev/zero of=/dev/da0 bs=512 count=40
and then continue with gpart create ....
BE CAREFUL with with dd as well, doublecheck you type /dev/da0

It the drive is old, install sysutils/smartmontools and check the drive's health and bad blocks.
 
This is a new hard drive under warranty!
after a repair under linux the hard drive is mounted!
I will start copying / pasting my directories.
I have a problem of rights access to the USB hard drive, I am no longer in root mode but user == phipo, I can do the following commands?
1 /
chown -R phipo:root /dev/da0*
2 /
chmod +x /dev/da0*

At the end I wish I could syncronize my NAS and my USB drive, I hope it is possible?
 
No, you have generally have to be root to run those commands.

Please don't start to blindly mess with the permissions of system files, be it in /dev or /usr or elsewhere.

To change permissions/ownership of devices look at devfs.conf(5).
There is more informatìon on that in the handbook I think. You can search the forum for more examples.

Good you harddisk is working now.
I'd like to see everything went well so nice if you could still post those...
2. Post output from gpart show da0
3. Post output from tunefs -p /dev/da0p1

To backup and keep my data in sync I use net/rsync.
It can sync remote or local folders, it's fast and powerful.
 
this is my output of commands :
Code:
root@sta-eliote:/usr/home/phipo # gpart show da0
=>        40  3907029095  da0  GPT  (1.8T)
          40  3907029080    1  freebsd-ufs  (1.8T)
  3907029120          15       - free -  (7.5K)
and
Code:
root@sta-eliote:/usr/home/phipo #  tunefs -p /dev/da0p1
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       disabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            6408
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)                                
root@sta-eliote:/usr/home/phipo #

can i put this parametres on /etc/devfs.conf
Code:
own     /dev/da0 phipo:/dev/da0
 
Disklayout is ok, but softupdates isn't enabled. Please recreate the filesystem by running newfs -jU /dev/da0p1

To be honest, I don't use devfs rules a lot, so I can't give you any advice without reading the manpage.
I guess you can find some helpful examples when you search the forum.

You should consider using security/doas or security/sudo to make a normal user execute commands that require root privileges.
Generally spoken, always think twice before giving a normal user account the rights to do privileged things without password.
 
this is my new output :
Code:
root@sta-eliote:/usr/home/phipo # tunefs -p /dev/da0p1
tunefs: POSIX.1e ACLs: (-a)                                disabled
tunefs: NFSv4 ACLs: (-N)                                   disabled
tunefs: MAC multilabel: (-l)                               disabled
tunefs: soft updates: (-n)                                 enabled
tunefs: soft update journaling: (-j)                       enabled
tunefs: gjournal: (-J)                                     disabled
tunefs: trim: (-t)                                         disabled
tunefs: maximum blocks per file in a cylinder group: (-e)  4096
tunefs: average file size: (-f)                            16384
tunefs: average number of files in a directory: (-s)       64
tunefs: minimum percentage of free space: (-m)             8%
tunefs: space to hold for metadata blocks: (-k)            6408
tunefs: optimization preference: (-o)                      time
tunefs: volume label: (-L)                                 
root@sta-eliote:/usr/home/phipo #

some one know /etc/devfs.conf ?
 
Back
Top