mirror of
				https://github.com/vdsm/virtual-dsm.git
				synced 2025-10-31 15:04:52 +08:00 
			
		
		
		
	Check system size
This commit is contained in:
		
							parent
							
								
									5f212b4041
								
							
						
					
					
						commit
						970502ee66
					
				| @ -124,13 +124,20 @@ if [ "$ALLOCATE" != "F" ]; then | |||||||
| 
 | 
 | ||||||
| else | else | ||||||
| 
 | 
 | ||||||
|   MB=(( (SYSTEM_SIZE + 1048575)/1048576 )) |   MB=$(( (SYSTEM_SIZE + 1048575)/1048576 )) | ||||||
| 
 | 
 | ||||||
|  |   echo "INFO: Writing ${MB} MB of zeroes.." | ||||||
|   dd if=/dev/zero of="${SYSTEM}" count="${MB}" bs=1M |   dd if=/dev/zero of="${SYSTEM}" count="${MB}" bs=1M | ||||||
|   truncate -s "${SYSTEM_SIZE}" "${SYSTEM}" |   truncate -s "${SYSTEM_SIZE}" "${SYSTEM}" | ||||||
| 
 | 
 | ||||||
| fi | fi | ||||||
| 
 | 
 | ||||||
|  | SIZE=$(stat -c%s "${SYSTEM}") | ||||||
|  | 
 | ||||||
|  | if [[ SIZE -ne SYSTEM_SIZE ]]; then | ||||||
|  |   echo "ERROR: System disk has the wrong size." && exit 89 | ||||||
|  | fi | ||||||
|  | 
 | ||||||
| PART="$TMP/partition.fdisk" | PART="$TMP/partition.fdisk" | ||||||
| 
 | 
 | ||||||
| {	echo "label: dos" | {	echo "label: dos" | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user