This is the modus operandi I used :

---%<-----------------------------------------------
# df -hT | grep /dev/xvda
/dev/xvda1       ext4       *8,9G*    6,3G  2,1G  76% /

# parted /dev/xvda 'unit s print' free
Model: Xen Virtual Block Device (xvd)
Disk /dev/xvda: 29360128s
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start      End        Size       Type     File system     Flags
        63s        2047s      1985s               Free Space
 1      2048s      18946047s  18944000s  primary  ext4
 2      18946048s  20969471s  2023424s   primary  linux-swap(v1)
        *20969472s  29360127s  8390656s            Free Space*

# free -h
              total        used        free      shared  buff/cache
available
Mem:          1,9Gi       209Mi       1,2Gi       6,0Mi       532Mi
1,6Gi
*Swap:         987Mi        *  0B       987Mi

swap is unused here so I can turn it off

# swapoff /dev/xvda2

Now I change the partition table :

# fdisk /dev/xvda -c

Welcome to fdisk (util-linux 2.34).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): *p*
Disk /dev/xvda: 14 GiB, 15032385536 bytes, 29360128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb607ef98

Device     Boot    Start      End  Sectors  Size Id Type
/dev/xvda1          2048 18946047 18944000    9G 83 Linux
/dev/xvda2      18946048 20969471  2023424  988M 82 Linux swap / Solaris

Command (m for help): *d*
Partition number (1,2, default 2): *1*

Partition 1 has been deleted.

Command (m for help): *n*
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1,3,4, default 1): *1*
First sector (2048-29360127, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-29360127, default
29360127):

Created a new partition 1 of type 'Linux' and of size 14 GiB.
Partition #1 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: *N*

Command (m for help): *a*
Partition number (1,2, default 2): *1*

The bootable flag on partition 1 is enabled now.

Command (m for help): *w*
The partition table has been altered.
Failed to update system information about partition 1: Périphérique ou
ressource occupé

The kernel still uses the old partitions. The new table will be used at the
next reboot.
Syncing disks.

# swapon /dev/xvda2

# fdisk -l /dev/xvda
Disk /dev/xvda: 14 GiB, 15032385536 bytes, 29360128 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xb607ef98

Device     Boot    Start      End  Sectors  Size Id Type
/dev/xvda1 *        2048 29360127 29358080   14G 83 Linux
/dev/xvda2      18946048 20969471  2023424  988M 82 Linux swap / Solaris

# reboot

# resize2fs /dev/xvda1
resize2fs 1.44.4 (18-Aug-2018)
Filesystem at /dev/xvda1 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 2
The filesystem on /dev/xvda1 is now 3669760 (4k) blocks long.

# df -hT | grep /dev/xvda
/dev/xvda1       ext4        *14G*    6,3G  6,8G  49% /
---%<-----------------------------------------------

Le mer. 25 mars 2020 à 15:33, GD rub <gdru...@gmail.com> a écrit :

> grwopart command  : would this not be the solution ?
>
>
> https://blog.myduniahosting.com/how-to-resize-your-root-diskpartition-online-for-linux/
>
> Le mer. 25 mars 2020 à 15:22, <dhorf-hfref.4a288...@hashmail.org> a
> écrit :
>
>> On Wed, Mar 25, 2020 at 03:12:04PM +0100, GD rub wrote:
>>
>> > You can't do that on the root filesystem. resize2fs is permissible only
>> if
>> > the partition is unmounted.
>>
>> actualy, no, resize2fs works just fine on a mounted filesystem.
>>
>>
>> > > > Device     Boot    Start      End  Sectors  Size Id Type
>> > > > /dev/xvda1          2048 18946047 18944000 *9G* 83 Linux
>> > > > /dev/xvda2      18946048 20969471  2023424  988M 82 Linux swap /
>> Solaris
>>
>> but in this case, you need to repartition first, and that is going to
>> be a problem while things are mounted.
>> and you will have to move the swap out of the way for resizing
>> the root partition too...
>>
>> i would recommend doing the resizing from a different appVM (or dom0).
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"qubes-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to qubes-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/qubes-users/CANE5ERbZQFaS2GuyO11u%3DQC7%2B3%2Be%3DohydQiQn%2BNi9HOoZ9DjMw%40mail.gmail.com.

Reply via email to