Tool for automating the partitioning of new disks in lcm

Alessandro De Gennaro 510cf56d2b Remove extra sectors (problem wasn't there) 4 years ago
.nfs000000000465d1ed0002b656 7d78986f51 Min size is now ceiled and not truncated in error messages 5 years ago
INSTALL 103d3d0bfc Added bash to the list of required software 5 years ago
LICENSE bc983272b7 Initial commit 5 years ago
README 9f8c0b3735 Added check to test if the user is root 5 years ago
check-device.sh db3c3e4543 Changed DIR variable 5 years ago
conversion.sh 2c7acf48ca Added way to specify sizes in sectors 5 years ago
error.sh 9f8c0b3735 Added check to test if the user is root 5 years ago
newdisk-automator dfcaf6727a Changed the directory to the production one 5 years ago
parse-arguments.sh 510cf56d2b Remove extra sectors (problem wasn't there) 4 years ago

README

newdisk-automator
A tool for automating the partitioning of new disks in lcm

Overview:
This program creates a new partition table on the disk, consisting of a single partition occupying the whole space.
It then divides the partition in up to four lvm logical volumes, whose size can be specified with the command line or calculated automatically by the program.
This program does not mount the new partitions, nor update the fstab: these operations have to be performed afterwards.

This program can be used in two mode: automatic and manual.

Automatic:
newdisk-automator [-qvf] device
device is partitioned according to the following scheme:
- calcolo: 100GB
- swap: ram size + 1GB
- free space: 10% of the total
- condor: 40% of remaining space
- tempdir: 60% of remaining space
If the size of the disk is less than 102GB + ram size, this mode cannot be used.
If the size of the disk is greater than the minimum size, but still less than (100GB + ram size) * 2, to use this mode the -f option must be passed.
Be careful: in the automatic mode, calcolo and swap size are fixed, and forcing it with -f could result in having very small tempdir and condor partitions.

Manual:
newdisk-automator [-qv] device temp_size condor_size swap_size vm_size
The partitions are assigned the size passed on the command line. S, b, K, M, G can be appended to the sizes for 512-byte-sectors, bytes, kibibytes, mebibytes and gibibytes. The default is bytes.
If the total passed with the command line is greater than the size of the disk, the program stops.

Error codes:
10 Usage error
11 Size units error

20 Device file does not exist
21 Device is not a block file
22 Device is mounted
23 Device is used as swap
24 Device is part of a used lvm volume
25 Device is part of a lvm volume group shared with other physical volumes
26 Device is not a regular disk (it may be a partition or another type of block file)

30 Device is too small to use default mode
31 Device does not have the reccomended size. Force with -f to use default mode
32 Device is smaller than the manually specified size

40 One of the programs called from the script returned a non 0 value. Check the stderr to get the code
41 The effective user id of the calling user is not 0. Only root can run this tool