Create UFS system for backups

Cesc

New Member


Messages: 1

Hello everyone, I have an extra hard drive and I would like to use it for small backups, How can I format it in UFS and add it in fstab?
 

Alain De Vos

Daemon

Reaction score: 606
Messages: 2,055

Remove the USB cable and plug it back in.
You can see which device it is /var/log/messages or via command "dmesg".
Create a partition table and partition.
man 8 gpart
Create a ufs filesystem
man 8 newfs
 

vigole

Daemon

Reaction score: 1,411
Messages: 1,237

-- Notes:
$ means run as normal user
# means run as root

1. List and find the name of your external disk:
$ grep -i disk /var/run/dmesg.boot
OR
# gpart show

-- Output:
Code:
.
.
ada0 ...
ada1 ...
da0 ...
da1 GPT (512G)
.
.

-- Attention: suppose, the 512G is the correct one => da1 is the name, aka /dev/da1

2. Create a GPT partition scheme
# gpart create -s gpt /dev/da1

2.1. Check that everything is OK:
# gpart show da1

-- Output:
Code:
da1 GPT (512G)
- free - (512G)

3. Add a new partition to the partitioning scheme:
# gpart add -t freebsd-ufs -a 1M /dev/da1

-- Notes:
-t type of partition (freebsd-ufs)
-a alignment (to 1MB boundary)

4. Then Format it:
# newfs -U /dev/da1p1

-- Note:
-U (Enable soft updates)

5. Create a mountpoint e.g. /backup
# mkdir /backup

6. Add the new partition to the /etc/fstab
# vi /etc/fstab

7. Add this line to the /etc/fstab
Code:
/dev/da1p1    /backup        ufs    rw    2    2

8. Mount it manually:
# mount /backup

9. Done

0. RTFM
man(1), vi(1), grep(1), mkdir(1), df(1), mount(1), gpart(8), newfs(8), fstab(5)
 

fcorbelli

Active Member

Reaction score: 54
Messages: 184

I do not suggest at all using UFS, least of all for backups.
For internal: go to zfs without thinking twice.
For external (USB): go to NTFS, without thinking twice.
 

Alain De Vos

Daemon

Reaction score: 606
Messages: 2,055

I use zfs on my external USB drives. Works fine.
For sharing you can use FAT32 and .tar.xz the contents.
 

fcorbelli

Active Member

Reaction score: 54
Messages: 184

FAT32 is limited to 4GB, much better a USB-NTFS-zpaqqed archive, that retain backup just like zfs' snapshot, forever.

You can't just compare archaic tar-based methods, it's like comparing UFS to zfs.
 
Top