Archive for December, 2019

How to install Samba running on top of ZFS in FreeBSD?

Assuming the FreeBSD is running as a guest VM inside VMWare. And we have just added a new harddisk (virtually) inside VMware – via the VM setting.

This additional harddisk will appear as "da2" inside FreeBSD’s "gpart show" command.

First destroy the harddisk to free up all the partitions and create ZFS filesystem on it:

gpart destroy -F da2

And now add back the harddisk to the system but without partition:

gpart create -s gpt da2

And "gpart show" gives:

After the following command:

zpool create peterpool /dev/da2

Checking status:

Yes, now "peterpool" is running ZFS.

And if you attempt "gpart show" now, the harddisk /dev/da2 is no longer visible to gpart – because the space now belongs to zpool for managment.

Next is to install Samba:

After "pkg search samba", which tells us the exact name to use for installation.

And then "pkg install samba48" (which is specific to this FreeBSD 12.1):

And all the locations of the configuration files:

And oops….samba4.8 does have some problem:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=239480

And so I did "pkg remove samba48" to uninstall it and reinstall the samba410 instead:

From above, the configuration tool is "samba-tool":

samba-tool domain provision –domain=TEST –use-rfc2307 –realm=test.home –adminpass=Mypassword0987

And then looking at the smb4.conf file:

Time for configuring the Samba.

References:

https://www.davd.io/samba-fileserver-on-freebsd/

https://blog.programster.org/zfs-cheatsheet

https://www.davd.io/samba-fileserver-on-freebsd/

https://www.youtube.com/watch?v=7BO5-3w5v-s

https://www.youtube.com/watch?v=khM4fPzYaUU

https://www.youtube.com/watch?v=7BO5-3w5v-s%20%20%20%20https://www.youtube.com/watch?v=khM4fPzYaUU

How to extend the VMDK filesystem if it is 100% utilized?

I had a problem: default installation of FreeBSD using the VMDK (https://download.freebsd.org/ftp/releases/VM-IMAGES/12.1-RELEASE/) approach always ended up with rootfs being 100% utilized.

So basically I cannot even “pkg install” any application.

If your rootfs in Freebsd (running as a guest VM in VMware) is 100% how to extend it so that more space is available?

First ensure the VMware guest is powered-down.

Then in the VM setting, select the harddisk that is used for the initial

Due to system configuration changes, initialization setup of th FreeBSD will be reexecuted again:

Doing a “gpart show”:

Notice that the filesystem to be extended is also the rootfs, which cannot be dismounted. So to minimize corruption, reboot the system in single user mode, and the issue “mount” to list out the mount feature.

Notice it is default “read-only” (from the “mount” command). Now issue “mount -o rw /dev/gpt/rootfs” to modify it to read-write mode (or “soft-updates” mode):

Next is to extend the filesystem (https://www.freebsd.org/doc/handbook/disks-growing.html):

we would like to extend the 3rd partition to 78G:

gpart resize -i 3 -s 78G -a 4k da0

and checking with “gpart show” again:

and followed by “growfs /dev/gpt/rootfs” or “growfs /dev/da0p3”.

After that:

Now rootfs is 5% utilized – lots of room for expansion.

References:

https://stackoverflow.com/questions/11659005/how-to-resize-a-virtualbox-vmdk-file

https://superuser.com/questions/1331791/how-to-shrink-vmware-disk-size

http://thenerdydeveloper.com/2019/04/06/how-to-resize-virtualbox-hard-disk-size-in-windows/

Vickblöm

Research scattered with thoughts, ideas, and dreams

Penetration Testing Lab

Offensive Techniques & Methodologies

Astr0baby's not so random thoughts _____ rand() % 100;

@astr0baby on Twitter for fresh randomness

The Data Explorer

playing around with open data to learn some cool stuff about data analysis and the world

Conorsblog

Data | ML | NLP | Python | R

quyv

Just a thought

IFT6266 - H2017 Deep Learning

A Graduate Course Offered at Université de Montréal

Deep Learning IFT6266-H2017 UdeM

Philippe Paradis - My solutions to the image inpainting problem

IFT6266 – H2017 DEEP LEARNING

Pulkit's thoughts on the course project

Thomas Dinsmore's Blog

No man but a blockhead ever wrote except for money -- Samuel Johnson

the morning paper

a random walk through Computer Science research, by Adrian Colyer

The Spectator

Shakir's Machine Learning Blog