

# Wait until all partition device nodes exist:ĭo echo "Waiting until $partition_device exists (retrying in 1 second)" # Report what is actually set up by parted:ĭo parted -s $harddisk_device unit GiB print Parted -s $harddisk_device set 2 lvm on type 0x8e Parted -s -align=optimal $harddisk_device unit % mkpart primary ext2 $partition2_begin_percentage $partition2_end_percentage Parted -s $harddisk_device set 1 lvm on type 0x8e Parted -s -align=optimal $harddisk_device unit % mkpart primary ext2 $partition1_begin_percentage $partition1_end_percentage # Use hardcoded parted fs-type "ext2" as dummy for now regardless what filesystem will be actually created there later:

Parted -s $harddisk_device mklabel $harddisk_disklabel The new disk label will have no partitions: # Erase filesystem, raid or partition-table signatures (magic strings) to clean up a used disk before making filesystems: # Make partitions on the harddisk devices:ĭo # Wait until the harddisk device node exists:ĭo echo "Waiting until $harddisk_device exists (retrying in 1 second)" # First of all clean up possibly already existing partitions:ĭo test -b $partition & wipefs -a -f $partition || trueĭo test -b $harddisk_device & wipefs -a -f $harddisk_device || true

LV_make_filesystem_command="mkfs.$LV_filesystem -F" Partition2_begin_percentage="$partition1_end_percentage" Harddisk_devices="/dev/sda /dev/sdb /dev/sdc"
#RESTORE FILE SYSTEM AFTER WIPEFS PLUS#
Plus proper waiting for block device nodes according
#RESTORE FILE SYSTEM AFTER WIPEFS INSTALL#
(my quick and ditry hack to install a system with LVM) Here some excerpts from my newest generic installation script Install Date: (not installed) Build Host: lamb10 Name : rear Relocations: (not relocatable) This was on SLES12SP1, with rear 2.00 package from OBS: After I hit 'y' on console, restore process continues. This prompt is visible in the log file, but not on system's console, there is just an empty line with a blinking cursor. Wipefs: Use the -force option to force erase. Wipefs: /dev/sda1: ignoring nested "dos" partition table on non-whole disk device +++ echo -e 'Creating filesystem of type ext3 with mount point /boot on /dev/sda1.' +++ Print 'Creating filesystem of type ext3 with mount point /boot on /dev/sda1.' 14:36:14 Creating filesystem of type ext3 with mount point /boot on /dev/sda1. During a restore, depending on what condition the target disk is in, wipefs will sometimes not wipe existing filesystem from the block device, and subsequent mkfs will stall the whole process, by interactively asking for confirmation:
