Disable automatic file expansion Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
madar

Disable automatic file expansion

Post by madar »

Hi,

Thank you for DietPi, this is exactly what I was been looking for.
However, is there a way to disable the automatic file expansion feature ? I need to define other partitions to fit my project's needs.
Or is it possible to reduce the expanded partition after DietPi has expanded ?

I'm lost with all the tutos about partitionning on linux... :( and I can't find a way to achieve it.

Thank you

Madar
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Disable automatic file expansion

Post by Fourdee »

madar wrote:Hi,

Thank you for DietPi, this is exactly what I was been looking for.
However, is there a way to disable the automatic file expansion feature ? I need to define other partitions to fit my project's needs.
Or is it possible to reduce the expanded partition after DietPi has expanded ?
Hi Madar,

You can resize and modify your partitions after DietPi has been fully installed.
To achieve this, you will need to:
- Boot a linux system with gparted installed (or Hirens boot cd and select Linux based rescue from the list).
- Plug in your SD card.
- Run gparted and resize the 2nd partition of your SD card.
- You can now create additional partitions on this SD card.

As DietPi runs the partition and filesystem expansion before it updates, to stop this from occurring, you would need to modify the source code after writing the DietPi image.
https://github.com/Fourdee/DietPi/blob/ ... #L213-L225
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
madar

Re: Disable automatic file expansion

Post by madar »

Hi,

Thank you ! I've modified the Dietpi image to set a size to the expanded partition. It perfectly works.

Madar

Edit : Only filesystem was set to the good size. So I finally used the first method : using gparted on an ubuntu machine. Now everything is ok. Thank you !

New question : I now wish to protect my Pi booting on read only filesystem except for the new partition I've created that I will use for keeping pesistent data changes. Do you have a good tutorial entry point ? I've followed some, but it seems it doesn't work so well. There were many errors during boot and sometimes whole system is freezing.

Thank you again :)
madar

Re: Disable automatic file expansion

Post by madar »

Maybe should I start a new thread for the new question ?
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Disable automatic file expansion

Post by Fourdee »

madar wrote: New question : I now wish to protect my Pi booting on read only filesystem except for the new partition I've created that I will use for keeping pesistent data changes. Do you have a good tutorial entry point ? I've followed some, but it seems it doesn't work so well. There were many errors during boot and sometimes whole system is freezing.
Have you tried mounting the 2nd partition as read only? Simply add the ro value into /etc/fstab:

Code: Select all

/dev/mmcblk0p2  / ext4  defaults,ro,errors=remount-ro,noatime  0 1
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
madar

Re: Disable automatic file expansion

Post by madar »

Hi,

Yes it works. Thank you. I've also added 'ro' at the end of the cmdline.txt file.
What does 'errors=remount-ro' stands for exactly ? If I'm on a readonly system, it should not have any error at all, isn't it ?
Do you think it's mandatory ?

Thank you for your time!
User avatar
Fourdee
Site Admin
Posts: 2788
Joined: Tue Feb 06, 2007 1:36 pm

Re: Disable automatic file expansion

Post by Fourdee »

madar wrote:What does 'errors=remount-ro' stands for exactly ? If I'm on a readonly system, it should not have any error at all, isn't it ?
Do you think it's mandatory ?

Thank you for your time!
If the partiton has an filesystem error (eg: corrupt data due to power loss), 'errors=remount-ro' will mount the partition as read only to prevent further damage.

As your always mounting the drive as read only, you can remove this flag. However, there is also no harm in leaving the flag in there.
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal or become a DietPi patron.
madar

Re: Disable automatic file expansion

Post by madar »

Ok, that's clear :) Thank you Fourdee !
Post Reply