For a valid partition we need in particular that every $x\in B_i$ divides every $y\in A\setminus B_i$.
Hence for different indices $i,j$ we one of $B_i\setminus B_j$, $B_j\setminus B_i$ must be emtpy, i.e., we have $B_i\subseteq B_j$ or $B_j\subseteq B_i$. So the $B_i$ are linearly ordered by inclusion:
$$\emptyset\subsetneq B_1\subsetneq B_2\subsetneq B_3\subsetneq \ldots \subsetneq B_{2017}\subsetneq A$$
Suppose for some $k$, $1\le k\le 2017$, we have $|B_{k+1}\setminus B_{k-1}|=2$ (with $B_0=\emptyset$ and $B_{2018}=A$ understood), so $B_{k}=B_{k-1}\cup \{m\}$, $B_{k+1}=B_{k}\cup\{n\}$ for some distinct numbers $m,n$. Then $\operatorname{lcm}(B_{k})=m$ and $\gcd(A\setminus B_{k})=n$, i.e., we should have $n=m$. We conclude $|B_{k+1}|\ge |B_{k-1}|+3$ for $1\le k\le 2017$. By induction, $|A|=|B_{2018}|\ge |B_0|+1009\cdot 3\ge 2027$.
But can this lower bound be achieved? Yes! For $n\in\Bbb N$ let
$$S_n=\{\,2^a3^b: |a-b|\le 1, a+b2n$ or $m>2n+1$, respectively,
$\gcd(S_m\setminus S_{2n})=\gcd(S_m\setminus S_{2n+1})=6^n$ as well.
Also $|S_{2n}|=3n$.
This allows us to pick $B_k=S_k$ for $1\le k\le 2017$ and $A=S_{2018}$ with $|A|=3027$.