There are many tutorials (e.g. the main I think: D.3. Installing Debian GNU/Linux from a Unix/Linux System), how to install a new Debian from one another. But they all sounds for me like you need a LiveCD to boot from.
I would like to install a Debian from a Debian and while install I want to have a possibility to repartition the whole disk (only one in the system). So if I use debootstrap I have to use a swap partition or to create a new partition at the end of the disk. But that means that I can't repartition the whole disk:
====== /boot ====== /swap ====== / ======
That means, I will have a partition in the middle of the disk? And what if I would like to use LVM? If I use fdisk and delete all the partitions and then create a new one (or two one normal for /boot and one for the rest of the system, e.g. /swap, /var, /var/tmp, etc.) then I can't use a
pvcreate /dev/sda1: it will say
Can't open /dev/sda1 exclusively. Mounted filesystem?
And if I will just format it all, I will not come back to the system...via SSH.
So how can I really install a new Debian from within an old one via SSH, with repartitioning using LVM?
the server provider makes the OS install in automated way (I need just select the OS and one from five "different" schemes, so no control of the installation process, I get only the server with Debian already installed on it)