LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 08-18-2021, 10:02 AM   #1
vucni45
Member
 
Registered: Aug 2021
Posts: 38

Rep: Reputation: Disabled
btrfs extend or shrink


Hi,
What are those steps to expand or shrink an btrfs over lvm?

-extend
lvextend --resizefs -L new_value /dev/mapper/y-y
-shrink
lvreduce --resizefs -L 400M /dev/mapper/y-y

Thank you
 
Old 08-18-2021, 10:49 AM   #2
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
I love using LVM with EXT4. I see no reason to use LVM with BTRFS.

If you must (and I am VERY curious why you would) I would look for two things: 1) how to do it with LVM and EXT4, then 2) how to do it with btrfs. You are going to be replacing the EXT4 steps with the BTRFS commands.

An article like this might help: https://unix.stackexchange.com/quest...cal-lvm-volume where someone else addressed a very similar question.
 
Old 08-18-2021, 06:42 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Madness.
btrfs is not (just) a filesystem, it is more a data manager - aka LVM+ext4 say or zfs. Putting btrfs on top of another block device layer makes no sense. Unless you have a very specific edge case - in which case let's hear about it.

How did you reach this configuration ?. I'm guessing an in-place conversion from ext to btrfs - if so, why ?.

Edit: btrfs wiki is here.

Last edited by syg00; 08-18-2021 at 06:50 PM.
 
Old 08-19-2021, 06:18 AM   #4
vucni45
Member
 
Registered: Aug 2021
Posts: 38

Original Poster
Rep: Reputation: Disabled
hi,
btrfs device usage /u
/dev/sdc, ID: 1
Device size: 20.00GiB
Data,single: 8.00MiB
Metadata,DUP: 2.00GiB
System,DUP: 16.00MiB
Unallocated: 17.98GiB

/dev/sde, ID: 2
Device size: 20.00GiB
Unallocated: 20.00GiB
Initially before to add /dev/sde
df -h /u
Filesystem Size Used Avail Use% Mounted on
/dev/sdc 20G 3.8M 18G 1% /u

After i added /dev/sde
df -h /u
Filesystem Size Used Avail Use% Mounted on
/dev/sdc 40G 3.8M 38G 1% /u

No need to expand /u.Give me example when i need to extend filesystem?Only if i shrunk first this filesystem?

then
btrfs filesystem resize 9g /u
Resize '/u' of '9g'
linux-l9l8:~ # df -h /u
Filesystem Size Used Avail Use% Mounted on
/dev/sdc 29G 3.8M 27G 1% /u

Why i have the size reduced at 29G?

btrfs fi sh /u
Label: none uuid: bed671b0-9e2b-47dd-b864-75f7cdfef0f0
Total devices 2 FS bytes used 416.00KiB
devid 1 size 9.00GiB used 2.02GiB path /dev/sdc
devid 2 size 20.00GiB used 0.00B path /dev/sde
I see that only filesystem on /dev/sdc is reduced to 9g.
if now
btrfs filesystem resize -9g /u
btrfs filesystem resize: invalid option -- '9'
usage: btrfs filesystem resize [devid:][+/-]<newsize>[kKmMgGtTpPeE]|[devid:]max <path>

Resize a filesystem

If 'max' is passed, the filesystem will occupy all available space
on the device 'devid'.
[kK] means KiB, which denotes 1KiB = 1024B, 1MiB = 1024KiB, etc.
why this?

Last edited by vucni45; 08-19-2021 at 08:37 AM.
 
Old 08-20-2021, 04:10 AM   #5
vucni45
Member
 
Registered: Aug 2021
Posts: 38

Original Poster
Rep: Reputation: Disabled
hi,
https://www.tecmint.com/create-btrfs...stem-in-linux/

it seems that it is not madness to have lvm under brtfs.
 
Old 08-20-2021, 12:22 PM   #6
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,631

Rep: Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696Reputation: 2696
Quote:
Originally Posted by vucni45 View Post
hi,
https://www.tecmint.com/create-btrfs...stem-in-linux/

it seems that it is not madness to have lvm under brtfs.
LVM is never madness, just needless complexity for many home users small machines.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot extend c:\win on dualboot as no unallocated space nextdoor partition, extend is greyed out on disk mgt, cyno77 Linux - Newbie 68 05-15-2021 09:11 PM
Extend Linux Partition (Extend LVM) osama.mansoor Linux - Newbie 5 11-27-2015 01:09 AM
LXer: Rollback To A Working State With btrfs + apt-btrfs-snapshot On Ubuntu 12.10 LXer Syndicated Linux News 0 11-25-2012 10:42 AM
ext4 vs btrfs, and with btrfs do I still need to use LVM? blue_k Linux - Software 4 08-17-2012 11:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 07:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration