## partitioning – Mount partitions before apache starts (ubuntu 20.04)

I’ve created virtual hosts and log folders on other partition. I’ve set automount partitions when system starts, but I noticed that apache runs first (before partitions are mounted), so it doesn’t see the path to VHs and log folder, and it doesn’t load because of that error. Each time I have to restart manually apache. I know that if apache would load a bit later after the drives are mounted then I wouldn’t have that error. How to solve this problem?

## discrete geometry – On Some Centers of Convex Regions Based On Partitions

These questions are inspired by Yaglom and Boltyanskii’s ‘Convex Figures’.

Winternitz Theorem: If a 2D convex figure is divided into 2 parts by a line l that passes through its center of gravity, the ratio of the areas of the two parts always lies between between the bounds 4/5 and 5/4.

Y and B also prove that for any triangle, there is no other point O than its center of gravity (centroid) for which the ratio of the partial areas into which the triangle is subdivided by lines thru O can be enclosed within narrower bounds.

Question 1: For any general convex 2D region, is the centre of mass still the point such that the areas into which the region is divided by lines thru that points are closest to each other? If the point we seek is not necessarily the centre of mass (seems unlikely), then it could be called the ‘area partition center’ of the region and finding this center for a general given region could be an algorithmic question.

Y and B also prove:
Let a bounded curve of length L that may consist of separate pieces be given in the plane. Then there is a point O in the plane so that each line through O divides the curve into 2 parts each having a length of not less than L/3.

Question 2: If L be the boundary of a single convex region, there must be a point O’ in its interior such that any line thru O’ divides the boundary into 2 portions such that the lengths of the two portions are closer than 1:3. What is a bound for this ratio for convex regions?

Let us define the perimeter partition center of a 2D convex region as that point P in its interior such that the 2 portions into which any line thru P divides the outer boundary are guaranteed to be closest to each other in length.

Example: For an isosceles triangle with very narrow base, this perimeter partition center is close to the mid point of the bisector of its apex angle and so clearly different from the centroid.

Question 3: Given a general convex region (even a triangle) to find its perimeter partition center.

Note: These questions have obvious 3D analogs with volume and surface area replacing area and perimeter.

## combinatorics – Number of partitions of an integer with a fixed number of parts

Is there an easy way in Mathematica to find the number of partitions of $$n$$ into $$k$$ parts? Or equivalently, the number of partitions of $$n$$ with largest part equal to $$k$$?

I realize the function IntegerPartitions[n,{k}] will return a list of all such partitions, which I could count, but I am wondering if there is a more efficient method.

## Two 4TB hard drives — how can I create a RAID 1 with two 2TB partitions?

I have been struggling with trying to get Disk Utility to allow me to divide a 4TB HD into two 2TB partitions, and then have a mirrored raid of that for redundancy. Is this not possible?

## mac – Problems moving free space between two partitions

On my Mac I installed another version on Mac OS on a new partition, with just the minimum required space available.

Now I would like to move and add some free space to it, having some problems in running the OS smoothly.
I tried with IPartiton and at it said the process was completed succesfully, but actually it left me just unallocated space, which does not belong neither to Partition A nor to partition B.

Now the situation is as follows:

Air-di-Edoardo:~ edoardo$diskutil list /dev/disk0 (internal, physical): #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *121.3 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS Macintosh HD 88.0 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 4: Apple_HFS Macintosh HD 2 31.6 GB disk0s4 5: Apple_Boot 650.0 MB disk0s5 Air-di-Edoardo:~ edoardo$ sudo gpt -r show /dev/disk0
start       size  index  contents
0          1         PMBR
2         32         Pri GPT table
34          6
40     409600      1  GPT part - C12A7328-F81F-11D2-BA4B-00A0C93EC93B
409640  171829272      2  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
172238912    1269536      3  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
173508448   61675864      4  GPT part - 48465300-0000-11AA-AA11-00306543ECAC
235184312    1269536      5  GPT part - 426F6F74-0000-11AA-AA11-00306543ECAC
236453848     524295
236978143         32         Sec GPT table


As you can see, having installed two OS, I also have two recovery partitions (can I delete one of them maybe?)

I am not sure how to move that unallocated space to “Macintosh HD2”.

I tried in recovery mode with:

diskutil resizevoume /dev/disk0s4 R


but the resizing process aborted with error: “the requested change in size is too small” (though volume Macintosh HD2 appears to be ok)

With a command like

sudo gpt add -b 236453848 -i 6 -s 524288 -t 48465300-0000-11AA-AA11-00306543ECAC /dev/disk0


I could assign the unallocateed space to a new partition but this would not solve my problem..

Could you please suggest me anything?

## partitions – Encryption unsuccessful – Cannot load dm-crypt mapping

I’m trying to encrypt my trend plus (S-7580) after installing the ROM AOSP 6.0.1

I think the issue happened after I clicked “resize” for all partitions in TWRP recovery.
And initially, the encryption fails silently (soft reboot and no change) with a logcat:

E Cryptfs : Bad magic for real block device /dev/block/platform/sdhci.1/by-name/userdata
E Cryptfs : Orig filesystem overlaps crypto footer region.  Cannot encrypt in place.


After some googling, I shrunk the userdata partition by 1M. Now the encryption fails with a UI error calling for a reset “Encryption unsuccessful. Encryption was interrupted and you need to perform a rest”.

I grabbed the logcat:

 E Cryptfs : Cannot load dm-crypt mapping table.
I Cryptfs : Encrypting ext4 filesystem in place...
I Cryptfs : Encrypting group 0
E Cryptfs : Error writing crypto_blkdev /dev/block/dm-1 for inplace encrypt
I Cryptfs : Encrypted to sector 0
E Cryptfs : Error encrypting groups
D Cryptfs : cryptfs_enable_inplace_ext4()=-1
E f2fs_sparseblock: Not a valid F2FS super block. Magic:0x023700 != 0xf2f52010
E f2fs_sparseblock: Failed to read superblock
E Cryptfs : Failed to encrypt f2fs filesystem on /dev/block/platform/sdhci.1/by-name/userdata
I Cryptfs : Encrypted to block -1
D Cryptfs : cryptfs_enable_inplace_f2fs()=-1
E Cryptfs : Encrypting filesystem in place...
E Cryptfs : Cannot seek to previously encrypted point on /dev/block/dm-1
D Cryptfs : cryptfs_enable_inplace_full()=-1



Not sure if these are all the relevant messages, so here is the full log.

Any help is much appreciated.

EDIT1: In my case, the userdata partition is working fine. I used resize2fs /dev/block/mmcblk0p19 (oldsize -1)M to shrink it by 1M. And I didn’t create any other partitions or filesystem. And all partitions are mounted just fine. So this linked question does not answer my question.

## partitions – What are the chances of a malware being persistent if I dd to write system.img and userdata.img from twrp

If I had a malware on my phone, say malware like xhelper, or strandhogg or something even critical than that, what are the chances of it being persistent even after using dd to write the system.img and userdata.img to the phone for eg dd if=system.img of=/dev/block/platform/mtk-msdc.0/by-name/system to write system as brand new. Is it possible that the malware could snoop into /cache or /nvdata to attain persistence. Is it feasible to use dd to flash those partitions as well?

## graphics – Mathematica 12.1 Crashes when making large partitions of an image

Thanks for contributing an answer to Mathematica Stack Exchange!

But avoid

• Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

## partitions – After doing a readback of my mediatek device in sp flash tool, why are some files in .bin format, others are in.img format, and others are blank?

After doing a readback of my mediatek device in sp flash tool, why are some files in .bin format, others are in.img format, and others are blank?

For e.g. the preloader is saved as .bin format, (as with logo.bin) and the boot/recovery/system partitions use .img

What format are the PGPT/ (partition tables) in? as they dont seem to have a file type?

## mbr – Grub or HAL not reading partitions

I’ve setup and old laptop machine (first Intel M without PAE flag visible) and try to instal WinXP and Lubuntu in a dual boot config. Beside there was a need to upgrade HDD therefore had to add mSATA SSD over IDE adapter in a 2.5” case.
Installing either OS onto a single partition works perfectly fine. If and when creating more than one partition and installing second OS I always get issues either with grub or ntldr depending which OS was installed to be run.
Grub goes directly into the rescue mode and no combination of config setup gives me possibility to recognize file system. It just does not access the file system. The same is with ntldr, it can’t access hal required by kernel. Running live distro can mount and read partitions but whatever is applied as a fix or grub reinstall or repair it does not boot on reboot.
There are many and mostly trivial scenarios covered in many dozen threads here but non, as far as I know, do refers how to resolve such issues in a real sense.
Reinstalling the OS doesn’t help, repairing mbr and grub doesn’t help. Actually there are no more scenarios I can think of I might try. Beside partition are mostly formatted with gparted or even fdisk to align sectors and cylinders figures but no help.

Important note is that such setup works perfectly fine over native PATA HDD but this is not long term solution for an obvious reasons. This leads me into the issue with bootloader and mSATA->IDE operation.

Hope someone can guide me into feasible solution here.

Thanks!