📜 ⬆️ ⬇️

Deploying Linux distribution with SCCM 2012

image

There appeared the need for a massive deployment of an image of the Linux user system (for example, xUbuntu 14.04) through System Center 2012 Configuration Manager. The official answer of microsoft to technet that it is impossible and in general, the maximum for which SCCM was designed for Linux did not work for deploying applications, and vague instructions were somewhat inaccurate or wasteful of resources, a solution was found empirically.

For those who still decided to step on this difficult (at the very very easy) way, I ask for a cat.
')
From third-party programs, we need only dd for dos . The rest can be done using standard linux and SCCM tools.

First you need to understand what size of the image we need and what size we are accordingly ready to allocate on the server (by the way, the average image of win 7 x64 with the installed software weighs about 10 gb). We will use the standard dd utility for installation, which byte-by-byte copies the contents of the entire hard disk or its partition. I used an 80GB hard drive and allocated a partition for a system in the amount of 9GB without swap.

image

After installation, the system can (and should) be customized for users' needs (install software, configs, etc.), the image will be removed from the configured system, I did not test the entry into the domain before the cloning step, after 15 seconds the computer enters the domain in a simple script .

After setup, you will need to boot from the installation media again. The image can be copied to an external drive, or it can be onto a network orb if the computer is connected to a local area network:

Create a folder for the mount and mount the network ball (-o if access to the ball requires a login and password)

mkdir cm mount -t cifs //    /cm(   ) -o user=_,pass= 

Now you need to decide on the correct copy of the image. Use the fdisk command to get information about partitions.

 fdisk -l 

image

The most important part is to use the dd command to copy the disk, specifying bs = 1024 (the number of bytes at a time) and count = 8787970 (this number is obtained from the number of passes of 1024 bytes to match the size of the partition that we want to clone + 2 since the partition starts with 2048 bytes, and we need the first bytes to save the disk layout. The difference with the other methods is that if you make a separate copy of the partition, the bootloader will not get up and there is a possibility that the markup will be beaten, and making a copy of the entire disk is expensive for the space occupied. Thus, we will be able to keep the image size as minimal as necessary and at the same time we will have a full-fledged copy of the HDD without any problems unfolding on any disk that is larger than the image size.

 dd if=/dev/sda of=/_____/.img bs=1024 count=8787970 

image

To monitor the dd status, use the command in the new terminal:

 watch -n5 'sudo kill -USR1 $(pgrep ^dd)' 

image

After completion, go to SCCM 2012. You need to create a new task sequence (select custom task sequence). First of all, let's go into the parameters of the sequence we created and we need to select the boot image to use (I use the x86 image).

image

Moving on to editing the sequence itself. First we mount the mount folder on the ball as a virtual drive that will be used to deploy xubuntu (there should be dd for dos, diskpart config and system image (add Connect to Network Folder):

image

The next step is to clear the disk partitioning, the contents of diskpart.txt (select Run Command Line):

select disk 0
clean

image

And the final step is to deploy the system to disk (select Run Command Line):

z:\dd if=z:\linux.img of=\\?\Device\Harddisk0\Partition0 bs=1024

image

Now that everything is ready, we boot into the boot image via the network and select our task sequence:

Careful, jackals
image

image

image

That's all, the image can be deployed on an unlimited number of machines and without much labor and resource costs through SCCM.

Source: https://habr.com/ru/post/276941/


All Articles