From: Alexey Gladkov <legion@kernel.org>
To: make-initrd@lists.altlinux.org
Subject: Re: [make-initrd] Расширение раздела с корнем
Date: Sun, 24 Nov 2024 18:17:17 +0100
Message-ID: <Z0NfnSFDxJDcccyt@example.org> (raw)
In-Reply-To: <c631d672-438e-40bb-9265-8a7806fca32c@basealt.ru>
On Sun, Nov 24, 2024 at 06:36:23PM +0300, Антон Мидюков wrote:
> 24.11.2024 15:51, Alexey Gladkov пишет:
> > On Sun, Nov 24, 2024 at 01:34:46PM +0300, Антон Мидюков wrote:
> >> 23.11.2024 20:59, Alexey Gladkov пишет:
> >>> On Sat, Nov 23, 2024 at 05:18:28PM +0300, Антон Мидюков wrote:
> >>>> 3. Раздел увеличивается, но файловая система нет. Так и должно быть? Или
> >>>> я что-то делаю не так. Сразу не заметил, так как в /etc/fstab был
> >>>> указан параметр монтирования x-systemd.growfs, благодаря чему файловая
> >>>> система расширялась systemd.
> >>>
> >>> Я это не реализовал так как в тот момент мне это не было нужно. Но считаю,
> >>> что раз возникла потребность, то это стоит сделать. Правда пока не не знаю
> >>> несколько это будет хлопотно.
> >>>
> >>
> >> В принципе, пока можно и с x-systemd.growfs жить. Но он привязан к
> >> systemd и не поддерживает, к примеру, f2fs, которая хорошо подходит для
> >> флешек (что акутально для планшетов, смартфонов, одноплатников).
> >
> > Сначала хотел привести относительно простой патч для поддержки, но беглое
> > чтение документации превратило патч вот в это:
> >
>
> Для ext4 утилита называется не resizefs, а resize2fs.
> И перед тем, как делать резайц, требуется выполнить:
> e2fsck -f "$1"
Да, я ошибся. Я не пробовал этот код.
> Также нужно будет сделать добавление утилит в initrd.
Да. Сделаешь патч ?
> > diff --git a/features/kickstart/data/bin/kickstart-sh-storage b/features/kickstart/data/bin/kickstart-sh-storage
> > index 2cd7b12c..5e794586 100644
> > --- a/features/kickstart/data/bin/kickstart-sh-storage
> > +++ b/features/kickstart/data/bin/kickstart-sh-storage
> > @@ -539,6 +539,59 @@ ks_get_dev_id()
> > printf '%s\n' "$1"
> > }
> >
> > +ks_requires_ext4=("resizefs")
> > +ks_requires_xfs=("xfs_growfs")
> > +ks_requires_f2fs=("resize.f2fs")
> > +ks_growfs()
> > +{
> > + local PROG
> > + local fs="" requires="" ret=0
> > +
> > + PROG="kickstart"
> > + message "command: ${FUNCNAME[0]} $*"
> > +
> > + fs="$(blkid --output value --match-tag TYPE -c /dev/null "$1")" ||
> > + return 0
> > +
> > + case "$fs" in
> > + ext*) requires="ks_growfs_ext4" ;;
> > + xfs) requires="ks_growfs_xfs" ;;
> > + f2fs) requires="ks_growfs_f2fs" ;;
> > + *)
> > + # resize unsupported.
> > + return 0
> > + ;;
> > + esac
> > +
> > + ks_check_requires "$requires" ||
> > + return 1
> > +
> > + verbose "Increase filesystem to partition size: $1"
> > +
> > + case "$fs" in
> > + ext*)
>
> Не
>
> > + resizefs "$1" ||
>
> а
>
> + e2fsck -f "$1" && resize2fs "$1" ||
> > + ret=1
> > + ;;
> > + xfs)
> > + mount -n -o rw,X-mount.mkdir \
> > + "$1" \
> > + "$ks_datadir/xfs.dir"
> > + xfs_growfs \
> > + "$ks_datadir/xfs.dir" ||
> > + ret=1
> > + umount -f \
> > + "$ks_datadir/xfs.dir"
> > + ;;
> > + f2fs)
> > + resize.f2fs "$1" ||
> > + ret=1
> > + ;;
> > + esac
> > +
> > + return $ret
> > +}
> > +
> > ks_requires_part=("numfmt" "sfdisk")
> > part()
> > {
> > @@ -828,6 +881,8 @@ part()
> >
> > printf ', %s\n' "$size" |
> > sfdisk -q -N "$partnum" "/dev/$dev"
> > +
> > + ks_growfs "/dev/$dev$partnum"
> > fi
> >
> > if [ -n "$encrypted" ]; then
> >
> >
>
>
> --
> С уважением, Антон Мидюков <antohami@basealt.ru>
> _______________________________________________
> Make-initrd mailing list
> Make-initrd@lists.altlinux.org
> https://lists.altlinux.org/mailman/listinfo/make-initrd
--
Rgrds, legion
next prev parent reply other threads:[~2024-11-24 17:17 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-16 5:23 Egor Shestakov
2024-11-16 13:28 ` Alexey Gladkov
2024-11-23 14:18 ` Антон Мидюков
2024-11-23 17:59 ` Alexey Gladkov
2024-11-24 10:34 ` Антон Мидюков
2024-11-24 12:51 ` Alexey Gladkov
2024-11-24 13:00 ` Антон Мидюков
2024-11-24 15:36 ` Антон Мидюков
2024-11-24 17:17 ` Alexey Gladkov [this message]
2024-11-24 17:29 ` Антон Мидюков
2024-11-25 19:02 ` Антон Мидюков
2024-11-26 16:01 ` Alexey Gladkov
2024-11-26 16:06 ` Антон Мидюков
2024-11-26 16:32 ` Alexey Gladkov
2024-11-26 16:47 ` Alexey Gladkov
2024-11-26 17:22 ` Антон Мидюков
2024-11-26 17:32 ` Alexey Gladkov
2024-11-26 17:44 ` Alexey Gladkov
2024-11-26 17:56 ` Антон Мидюков
2024-11-26 18:16 ` Alexey Gladkov
2024-11-27 14:32 ` Alexey Gladkov
2024-11-28 13:04 ` Alexey Gladkov
2024-11-28 13:07 ` Антон Мидюков
2024-11-29 15:15 ` Антон Мидюков
2024-11-29 16:01 ` Alexey Gladkov
2024-11-29 16:07 ` Alexey Gladkov
2024-11-29 16:17 ` Антон Мидюков
2024-11-29 16:34 ` Alexey Gladkov
2024-11-29 18:13 ` Антон Мидюков
2024-11-29 19:00 ` Alexey Gladkov
2024-11-29 20:10 ` Антон Мидюков
2024-11-29 21:39 ` Alexey Gladkov
2024-11-24 13:21 ` Alexey Gladkov
2024-11-24 13:22 ` Антон Мидюков
2024-11-24 13:34 ` Alexey Gladkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z0NfnSFDxJDcccyt@example.org \
--to=legion@kernel.org \
--cc=make-initrd@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Make-initrd development discussion
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/make-initrd/0 make-initrd/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 make-initrd make-initrd/ http://lore.altlinux.org/make-initrd \
make-initrd@lists.altlinux.org make-initrd@lists.altlinux.ru make-initrd@lists.altlinux.com
public-inbox-index make-initrd
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.make-initrd
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git