Re: Transfer storage from home to var

2023-02-04 Thread roman . meier
Hi Dashamir,

The reassigning seemed to finally work using: 

sudo lvresize -r -L-10G /dev/vg_system/skole+tjener+home0
sudo lvresize -r -L+10G /dev/vg_system/var

Then I'm getting the following output:

root@tjener:/skole/tjener/home0/roman# sudo vgdisplay
  --- Volume group ---
  VG Name   vg_system
  System ID 
  Formatlvm2
  Metadata Areas1
  Metadata Sequence No  79
  VG Access read/write
  VG Status resizable
  MAX LV0
  Cur LV10
  Open LV   10
  Max PV0
  Cur PV1
  Act PV1
  VG Size   930.55 GiB
  PE Size   4.00 MiB
  Total PE  238222
  Alloc PE / Size   238088 / 930.03 GiB
  Free  PE / Size   134 / 536.00 MiB
  VG UUID   1Ekw6T-kY0s-iJjc-HV4x-ldxG-kQNh-ZTAATE
   
root@tjener:/skole/tjener/home0/roman# sudo lvdisplay
  --- Logical volume ---
  LV Path/dev/vg_system/root
  LV Nameroot
  VG Namevg_system
  LV UUIDKm3Z2m-ei4I-zPaG-AanS-oPsF-4y1u-BmGGag
  LV Write Accessread/write
  LV Creation host, time localhost, 2019-12-22 00:17:48 +
  LV Status  available
  # open 1
  LV Size<38.36 GiB
  Current LE 9820
  Segments   7
  Allocation inherit
  Read ahead sectors auto
  - currently set to 256
  Block device   254:0
   
  --- Logical volume ---
  LV Path/dev/vg_system/usr
  LV Nameusr
  VG Namevg_system
  LV UUIDyhlCZE-cqhZ-DvAd-aHBc-Mdhr-nwDS-abfPMN
  LV Write Accessread/write
  LV Creation host, time localhost, 2019-12-22 00:17:49 +
  LV Status  available
  # open 1
  LV Size25.00 GiB
  Current LE 6400
  Segments   4
  Allocation inherit
  Read ahead sectors auto
  - currently set to 256
  Block device   254:2
   
  --- Logical volume ---
  LV Path/dev/vg_system/var
  LV Namevar
  VG Namevg_system
  LV UUIDFcNFe9-yd08-DKtF-u3Cl-OGvr-mF48-USUnAV
  LV Write Accessread/write
  LV Creation host, time localhost, 2019-12-22 00:17:49 +
  LV Status  available
  # open 1
  LV Size<27.26 GiB
  Current LE 6978
  Segments   5
  Allocation inherit
  Read ahead sectors auto
  - currently set to 256
  Block device   254:3
   
  --- Logical volume ---
  LV Path/dev/vg_system/var+log
  LV Namevar+log
  VG Namevg_system
  LV UUIDMYTIao-Vio4-jRik-0gb3-Egg7-sQbc-UMaeNe
  LV Write Accessread/write
  LV Creation host, time localhost, 2019-12-22 00:17:49 +
  LV Status  available
  # open 1
  LV Size<4.77 GiB
  Current LE 1220
  Segments   1
  Allocation inherit
  Read ahead sectors auto
  - currently set to 256
  Block device   254:4
   
  --- Logical volume ---
  LV Path/dev/vg_system/swap_1
  LV Nameswap_1
  VG Namevg_system
  LV UUIDlQSvdd-hcUB-9bdV-LkN1-UiMI-PhqC-zLW71E
  LV Write Accessread/write
  LV Creation host, time localhost, 2019-12-22 00:17:49 +
  LV Status  available
  # open 2
  LV Size3.81 GiB
  Current LE 976
  Segments   1
  Allocation inherit
  Read ahead sectors auto
  - currently set to 256
  Block device   254:1
   
  --- Logical volume ---
  LV Path/dev/vg_system/opt
  LV Nameopt
  VG Namevg_system
  LV UUIDQ23PB4-n1bk-H3Xg-kjjO-NbUA-AZ8n-9TWQzw
  LV Write Accessread/write
  LV Creation host, time localhost, 2019-12-22 00:17:50 +
  LV Status  available
  # open 1
  LV Size<37.52 GiB
  Current LE 9604
  Segments   3
  Allocation inherit
  Read ahead sectors auto
  - currently set to 256
  Block device   254:5
   
  --- Logical volume ---
  LV Path/dev/vg_system/var+opt+ltsp+swapfiles
  LV Namevar+opt+ltsp+swapfiles
  VG Namevg_system
  LV UUIDjpN2ka-TLP3-1GsX-lUlV-Khz7-7QGt-BkM8km
  LV Write Accessread/write
  LV Creation host, time localhost, 2019-12-22 00:17:50 +
  LV Status  available
  # open 1
  LV Size3.81 GiB
  Current LE 976
  Segments   1
  Allocation inherit
  Read ahead sectors auto
  - currently set to

Re: Transfer storage from home to var

2023-02-04 Thread roman . meier
Hi Petter,

The following worked based on your suggestion:

sudo lvresize -r -L-10G /dev/vg_system/skole+tjener+home0
sudo lvresize -r -L+10G /dev/vg_system/var

I hope this was safe and nothing got lost on home0 ;)

Kind regards,
Roman

> On 02/03/2023 9:04 AM GMT Petter Reinholdtsen  wrote:
> 
>  
> [Roman Meier]
> > However, extending the size of /var didn't work:
> >
> > sudo lvextend -L+5G /dev/vg_system/var
> >   Insufficient free space: 1280 extents needed, but only 138 available
> 
> I would strongly recommend not using lvextend, and instead use lvresize
> -r.  I suspect the underlying LVM logical volume is already increased,
> but the file system on top is not, and thus you do not see the space.
> 
> Perhaps 'lvresize -r -L+1M /dev/vg_system/var' work better.
> 
> -- 
> Happy hacking
> Petter Reinholdtsen



Re: Transfer storage from home to var

2023-02-03 Thread Dashamir Hoxha
On Fri, Feb 3, 2023 at 9:43 AM  wrote:

>
> sudo lvextend -L+5G /dev/vg_system/var
>   Insufficient free space: 1280 extents needed, but only 138 available
>

If you don't mind, can you share the output of the commands:

sudo vgdisplay
sudo lvdisplay

If you just say "it doesn't work", without providing some context, it is
difficult to guess what might be wrong.

Dashamir


Re: Transfer storage from home to var

2023-02-03 Thread Petter Reinholdtsen
[Roman Meier]
> However, extending the size of /var didn't work:
>
> sudo lvextend -L+5G /dev/vg_system/var
>   Insufficient free space: 1280 extents needed, but only 138 available

I would strongly recommend not using lvextend, and instead use lvresize
-r.  I suspect the underlying LVM logical volume is already increased,
but the file system on top is not, and thus you do not see the space.

Perhaps 'lvresize -r -L+1M /dev/vg_system/var' work better.

-- 
Happy hacking
Petter Reinholdtsen



Re: Transfer storage from home to var

2023-02-03 Thread roman . meier
Hi Petter,

I wrote the email a bit too hastily. Sorry for causing this confusion.

It's /var and not /dev.

Again, I was able to nicely reduce the size of /skole/jener/home0.

However, extending the size of /var didn't work:

sudo lvextend -L+5G /dev/vg_system/var
  Insufficient free space: 1280 extents needed, but only 138 available

Kind regards,
Roman

> On 02/02/2023 9:21 PM GMT Petter Reinholdtsen  wrote:
> 
>  
> [Roman Meier]
> > As mentioned in my email, I was able to reduce the size of
> > /skole/jener/home0. I therefore logged in als root and unmounted
> > /skole/jener/home0.
> 
> OK, then I misunderstood.  I read your email to say that you chould not
> find a way to reduce the size.
> 
> > For unknown reasons this space is however not made available to be
> > reassigned to /dev resulting in the error message mentioned.
> 
> Reducing home in LVM would just make ununsed space available to LVM,
> visible using vgs.  This unused space chan then be allocated to other
> partitions using lvresize on this partition.
> 
> You might want to check if you really need space on /dev/, it seem like
> the wrong partition to extend.
> -- 
> Happy hacking
> Petter Reinholdtsen



Re: Transfer storage from home to var

2023-02-02 Thread Dashamir Hoxha
On Thu, Feb 2, 2023 at 9:30 PM  wrote:

>
> As mentioned in my email, I was able to reduce the size of
> /skole/jener/home0. I therefore logged in als root and unmounted
> /skole/jener/home0.
>

This is usually done in two steps: first you resize (shrink) the
filesystem, then you resize (shrink) the LVM partition.
The first step should look like this:

umount /dev/vg_system/home
e2fsck -f /dev/vg_system/home
resize2fs /dev/vg_system/home 90G # assuming it is 100G

For the second step you use the lvresize or lvreduce, as explained by
Petter.

Dashamir


Re: Transfer storage from home to var

2023-02-02 Thread Petter Reinholdtsen
[Roman Meier]
> As mentioned in my email, I was able to reduce the size of
> /skole/jener/home0. I therefore logged in als root and unmounted
> /skole/jener/home0.

OK, then I misunderstood.  I read your email to say that you chould not
find a way to reduce the size.

> For unknown reasons this space is however not made available to be
> reassigned to /dev resulting in the error message mentioned.

Reducing home in LVM would just make ununsed space available to LVM,
visible using vgs.  This unused space chan then be allocated to other
partitions using lvresize on this partition.

You might want to check if you really need space on /dev/, it seem like
the wrong partition to extend.
-- 
Happy hacking
Petter Reinholdtsen



Re: Transfer storage from home to var

2023-02-02 Thread roman . meier
Hi Petter,

Thanks for your fast reply!

As mentioned in my email, I was able to reduce the size of /skole/jener/home0. 
I therefore logged in als root and unmounted /skole/jener/home0.

For unknown reasons this space is however not made available to be reassigned 
to /dev resulting in the error message mentioned.

Kind regards,
Roman

> On 02/02/2023 12:23 PM GMT Petter Reinholdtsen  wrote:
> 
>  
> [Roman Meier]
> > I have run out of storage on /var and I can't extend size because all
> > on the harddrive has been used already.
> >
> > I have about 50G unused space on /skole/jener/home0 but I find it
> > difficult to transfer storage from /skole/jener/home to /dev.
> 
> I normally boot in single user, unmount /skole/jener/home0 and run
> lvresize -r -L-10g /dev/vg_system/home or similar.
> 
> -- 
> Happy hacking
> Petter Reinholdtsen



Re: Transfer storage from home to var

2023-02-02 Thread Petter Reinholdtsen
[Roman Meier]
> I have run out of storage on /var and I can't extend size because all
> on the harddrive has been used already.
>
> I have about 50G unused space on /skole/jener/home0 but I find it
> difficult to transfer storage from /skole/jener/home to /dev.

I normally boot in single user, unmount /skole/jener/home0 and run
lvresize -r -L-10g /dev/vg_system/home or similar.

-- 
Happy hacking
Petter Reinholdtsen



Transfer storage from home to var

2023-02-02 Thread roman . meier
Hi folks,

I have run out of storage on /var and I can't extend size because all on the 
harddrive has been used already.

I have about 50G unused space on /skole/jener/home0 but I find it difficult to 
transfer storage from /skole/jener/home to /dev.

I was able to reduce storage of /skole/jener/home by about 10G but assigning 5G 
of it to /dev results in an error message:

root@tjener:/skole/tjener/home0/roman# sudo lvextend -L+5G /dev/vg_system/var
  Insufficient free space: 1280 extents needed, but only 138 available
root@tjener:/skole/tjener/home0/roman# sudo lvextend -L+9G /dev/vg_system/var

Any ideas?

Kind regards,
Roman