Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rootfs-resize 0.3 #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 20 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,30 @@
rootfs-resize
=============

Version 2.0 - 2013-01-14
Version 2.3 - 2013-12-12
------------------------

This is a rewrite, in python, of the previous rootfs-resize
bash script. This version uses libparted (via pyparted) and
better logic for improved robustness.

rootfs-resize is a python service script designed for use on
computers that use an SD card for storage, such as ARM development
boards. Since SD cards can be purchased in various sizes, and
since even cards of the same nominal size may have slightly
different capacities, it is impossible to create an SD card
image guaranteed to exactly fit a card. It is also inefficient
to have an image that is larger than the files contained within
that image, because the "extra space" will slow compression,
download, and SD-card burn activities.

As a result, the Fedora ARM SD card images typically contain
a boot filesystem (usually FAT/VFAT) followed by a Linux extX
root filesystem. The second filesystem is sized so that it
is just big enough for the contained files.

The rootfs-resize script attempts to resize the root (typically
second) partition on the SD card to fill the device. It
does this by adjusting the end of the root partition and then
rebooting. On the next boot, a resize2fs is performed
to resize the filesystem.

The name of the block device containing the root filesystem must
be /dev/sdX or /dev/mmcblk0pX, and it must contain an ext[234]
partition.

In order to resize the partition, the file /.rootfs-repartition
must be present. After the partition resize operation, this file
is removed and the file /.rootfs-resize is created (Phase 1); on
next boot, when the resize2fs is started, the /.rootfs-resize file is
removed (Phase 2).

If the file /.swapsize exists and contains an integer number
in text format during Phase 2, a swap file (/swap0) of that size
in megabytes is created after the filesystem is resized. This swap
file is added to /etc/fstab and activated.

The operation of this service may be disabled in either of these
two ways (in addition to disabling the service unit file):
rootfs-resize 0.3 release

1. By passing a kernel command line argument of "nofsresize"
2. By creating the file /.nofsresize
This is a rewrite, in python, of the previous rootfs-resize bash script. This version uses libparted (via pyparted) and better logic for improved robustness.

rootfs-resize is a python service script designed for use on computers that use an SD card for storage, such as ARM development boards. Since SD cards can be purchased in various sizes, and since even cards of the same nominal size may have slightly different capacities, it is impossible to create an SD card image guaranteed to exactly fit a card. It is also inefficient to have an image that is larger than the files contained within that image, because the "extra space" will slow compression, download, and SD-card burn activities.

As a result, the Fedora ARM SD card images typically contain a boot filesystem (usually FAT/VFAT) followed by a Linux extX root filesystem. The second filesystem is sized so that it is just big enough for the contained files.

The rootfs-resize script attempts to resize the root partition on the SD card to fill the device. It does this by adjusting the end of the root partition and then rebooting. It will also determine if the root partition is logical, and if it is it will find the extended partition and resize it. On the next boot, a resize2fs is performed to resize the filesystem.

If either of these suppressions flags are present, the script
will not run.
The name of the block device containing the root filesystem must be /dev/sdX or /dev/mmcblk0pX, and it must contain an ext[234] partition.

This script and the corresponding systemd unit file are licensed
under the GPL v2, or at the user's discretion, any later version.
In order to resize the partition, the file /.rootfs-repartition must be present. After the partition resize operation, this file is removed and the file /.rootfs-resize is created (Phase 1); on next boot, when the resize2fs is started, the /.rootfs-resize file is removed (Phase 2).

If the file /.swapsize exists and contains an integer number in text format during Phase 2, a swap file (/swap0) of that size in megabytes is created after the filesystem is resized. This swap file is added to /etc/fstab and activated.

The operation of this service may be disabled in either of these two ways (in addition to disabling the service unit file):

1. By passing a kernel command line argument of "nofsresize"
2. By creating the file /.nofsresize

The web page and git repository for this code is accessible at the
[Github Repo](https://github.com/ctyler/rootfs-resize)
If either of these suppressions flags are present, the script will not run.

This script and the corresponding systemd unit file are licensed under the GPL v2, or at the user's discretion, any later version.
Loading