Installing Nethserver on previously used hard drives

I am new to Nethserver and recently installed it (7.4) on a lab PC that has two 5TB drives. The installation went fine and I explored some of the various applications and configuration options. I had selected the local LDAP accounts provider and ultimately decided that I wanted to configure the AD accounts provider. Based on what I read in the documentation this would require starting over with a ‘fresh’ install. When I attempted to perform a ‘fresh’ install I was confronted with ‘not enough disk space’. I attempted to reclaim the space but it appeared to fail (partitions were deleted but sda/sdb always showed ‘preserve’). I tried interactive and unattended installation modes but always ended up with ‘not enough disk space’. I understood from the documentation the the installation procedure would ‘wipe’ existing data from the hard drives but this does not seem to be the case. It appears that if the hard drives have previously existing LVM/RAID metadata the automated installation procedure will not remove it. After many hours of searching the documentation, the forums, trying to removes the metadata, etc. I am at a loss. Can anybody explain or point me to the proper procedure that will allow a ‘fresh’ Nethserver installation on drives that had a previous Nethserver installation. Thanks!

Aside from the fact that it should be possible to delete this info, I usualy do not care for automatic partitioning schemes removing existing info, this should help you out: https://gparted.org/livecd.php

Thanks for the reply Jeroen. Actually gparted didn’t work, I had previously booted a Linux Mint live cd and used gparted to remove the partition data from both hard drives, tried the interactive and unattended Nethserver installation and ended up with the same results (‘not enough disk space’). I also used fdisk from the live cd to remove the partition data, retried the installation and it still reported ‘not enough space’. Another thing I tried was to use dd to zero the first 200 MB and last 200MB of each drive, still could not get either of the automated installations to work. What is baffling me is the documentation indicates this shouldn’t be happening.

Have you labled it as gpt? MBR is not working with harddrives bigger than 2 TB.
If not, you should have a look here:

PS: Did you try a CentOS installation and install nethserver at this installation?

1 Like

Michael, yes both of the hard drives have gpt labels. I had previously installed Nethserver using the unattended procedure and had worked with the installation for a couple of days before I decided I wanted to start over with a ‘fresh’ installation. When I followed the same unattended installation procedure it halted on the Centos 7 screen that indicated there was insufficient space on the hard drives. I then tried the interactive installation and the other steps I outlined above with no success. What I am trying to understand is why the Nethserver installation scripts do not remove all data from the targeted hard drives as the documentation states and if this is a known ‘bug’ with a workaround procedure. I also had the same experience when I used a different pair (320GB) of hard drives that I first installed using the unattended installation procedure and then tried to perform a ‘fresh’ install on the same. I will update with more information from the failed installer screen…

Thanks for your explanation,
I didn’t tried your scenario.
You could try to boot with the live CD and remove the lvm with lvmremove like here:

Perhaps the dev team has an explanation. @dev_team

I recall some fails like this when a raid/lvm flag is used on former disk, you should erase the mbr by ‘dd’ on all disks by using a live distro

dd if=/dev/zero of=/dev/sdX

Do not wait the end, interrupt by ctrl+c when you feel it and do not make a mistake on the drives to erase

2 Likes

Other commands that could be useful:

dmraid -r -E /dev/sdX

dd if=/dev/zero of=/dev/sdX bs=1k count=1; dd if=/dev/zero of=/dev/sdX bs=1k seek=$((fdisk -s /dev/sdX - 2))

3 Likes

This is an old topic, but i did a complete reinstall of the latest 7.8 Netserver on a a single 256GB SSD that I used previously in the same configuration. Using an interactive install, I tried the reclaim space on all of the existing partitions, but the reclaim space option failed. I discovered that if i did an unattended install, it reclaimed space automatically. I know installs and reinstalls are infrequent, but this was a maddening experience. I used an EFI install.

I tried saitobenkei’s suggested commands, they didn’t help, I also tried stephdl’s suggestion, but I guess I don’t understand what he means by “do not wait the end”.

You can also try to delete the partitiontable with gdisk:

gdisk /dev/sda

P.S. “do not wait the end” means that you dont have to wipe the hole disk. You just need to wipe the first part of the disk…

1 Like

I usually use sgdisk because it simply will wipe everything (RAID, ZFS, LVM, …) and create a fresh GPT
the option -Z or --zap-all will zap (destroy) everything including GPT and MBR data structures

so it would be something like this

sgdisk -Z /dev/sda
sgdisk -Z /dev/sdb

or sgdisk -Z /dev/sd{a,b}

but if you want to play around with configuration and testing stuff and even maybe help the community you might want to install nethserver as a VM under proxmox which will provide you backup and snapshot of your machine.

2 Likes

use a bootable iso like ubuntu and in a terminal

dd if=/dev/zero of=/dev/sda

it will wipe the disk, don’t wait the end, ctrl+c

1 Like