LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-08-2017, 03:07 AM   #1
postcd
Member
 
Registered: Oct 2013
Posts: 527

Rep: Reputation: Disabled
Advice on re-partitioning default Debian 9 stretch to support LVM


Hello,

my server provider installed Debian 9 stretch 64bit and this is the disk space layout after installation:
https://pastebin.com/E0DHUhrG

The tmpfs and udev filesystems seems not to be using any disk space according to that figures. But they have big quotas?

Code:
/dev/sda1  *          2048 1031962623 1031960576 492.1G 83 Linux
/dev/sda2       1031964670 1166012415  134047746  63.9G  5 Extended
/dev/sda5       1031964672 1166012415  134047744  63.9G 82 Linux swap / Solaris
I would like to have one big LVM volume, around 80% of the disk space and i am expecting i will be tight on disk space on this volume.

In the future will it anyhow limit me to have udev tmpfs so high quota when my main/largest LVM volume will need more disk space in future?

Would be wise to convert everything to LVM so i can resize them easily in future? Here is mentioned that it may not be good idea to convert root partition into LVM.

I see i can use "fdisk /dev/sda" to change /dev/sda1 type from Linux to Linux LVM.
But when reading this page, i am unsure if this LVM change in fdisk is all what i need to do, if i do not need to install some LVM software. apt-get install lvm2 says:
The following NEW packages will be installed:
dmeventd libdevmapper-event1.02.1 liblvm2app2.2 liblvm2cmd2.02 libreadline5 lvm2
Also there is LVM2. What is a difference between Linux LVM type created by fdisk and lvm2 installed by "apt-get install lvm2" ? Thank You for advises what is needed to convert my setup to LVM.

Last edited by postcd; 07-08-2017 at 03:15 AM.
 
Old 07-08-2017, 05:06 AM   #2
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
First that I can see on that is that swap has 63G partition. What for? How much ram you got there? Your swap partition should be 2xram if you have up to 4G ram, and about ram+2G if you have more than 4G ram. Some people are ok with root on lvm, some are not. Personally, I think it is easier to put root on separate partition, but to each its own. You do not need much space for root, specially not for server. About 10G would be more than enough, with 20G you could have several desktop environments and all you need for server.

Also, what for do you need tmpfs and udev with so high quota? Quota for those is in percentages of available space, so it is so high because your / is so big. But it is not like those will be much of space eaters, for normal usage. If you expect them, or something else on / to have more space, you can give root bit more gigs.

Last edited by dejank; 07-08-2017 at 05:13 AM.
 
Old 07-08-2017, 05:17 AM   #3
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Quote:
Also there is LVM2. What is a difference between Linux LVM type created by fdisk and lvm2 installed by "apt-get install lvm2" ? Thank You for advises what is needed to convert my setup to LVM.
Fdisk is tool for partitioning. LVM2 is package with tools to manage lvm. Suggested read: https://wiki.debian.org/LVM. Also here https://www.tecmint.com/create-lvm-storage-in-linux/

Last edited by dejank; 07-08-2017 at 05:20 AM.
 
Old 07-08-2017, 05:24 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
No, tmpfs defaults to half RAM - it's memory-resident, so for this discusssion can be totally ignored. There's a file in the source tree that explains most of it.
The old "rules of thumb" for swap are generally meaningless for such large systems.

As for LVM, the tldp page is hopelessly outdated. LVM2 is the default when LVM is mentioned these days - much like no-one says grub2 anymore, "grub" means what was grub2.
Just changing the partition type will have zero effect. I'm sure Debian must have some decent LVM doco somewhere, else go get the RHEL LVM admin guide; free to download, and excellent.
 
Old 07-08-2017, 05:29 AM   #5
dejank
Member
 
Registered: May 2016
Location: Belgrade, Serbia
Distribution: Debian
Posts: 229

Rep: Reputation: Disabled
Quote:
No, tmpfs defaults to half RAM - it's memory-resident, so for this discusssion can be totally ignored. There's a file in the source tree that explains most of it.
The old "rules of thumb" for swap are generally meaningless for such large systems.
Aye, thanks for explanation, totally forgot about that for tmpfs. So, if you have 64G ram, forget what I've said about swap.
 
Old 07-08-2017, 05:52 AM   #6
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Quote:
Originally Posted by postcd View Post
Hello,

my server provider installed Debian 9 stretch 64bit and this is the disk space layout after installation:
https://pastebin.com/E0DHUhrG

The tmpfs and udev filesystems seems not to be using any disk space according to that figures. But they have big quotas?
tmpfs and udev filesystems reside strictly in RAM (they can be offloaded into the swap space if necessary, just like anything else in RAM). The default for tmpfs is to place a size limit equal to half of physical RAM, but /run doesn't use the default (it uses a limit much lower than that).

So, I see your server has 64GB of RAM, seeing as the tmpfs file systems which use the default size setting (i.e. not specified in mount output) are 32GB in size.

The size of swap here has been chosen to equal physical RAM, which is good if you want to use the hibernation feature. Hibernation writes the contents of RAM into swap before powering down. Then, on the next boot it will restore those contents into RAM to continue where it left off. Personally, I have never used hibernation. It might be useful if you're running some sort of software which is impossible to cleanly shut down (bad design!!!) and you've got a UPS that you know is about to run out of battery.

Personally, I prefer to use a swap file rather than a swap partition, even if that means no hibernation feature. A swap file is much more convenient for me, since it's easier to add/remove them, and immediately flexibly utilize the space available/saved.
Quote:
Code:
/dev/sda1  *          2048 1031962623 1031960576 492.1G 83 Linux
/dev/sda2       1031964670 1166012415  134047746  63.9G  5 Extended
/dev/sda5       1031964672 1166012415  134047744  63.9G 82 Linux swap / Solaris
I would like to have one big LVM volume, around 80% of the disk space and i am expecting i will be tight on disk space on this volume.

In the future will it anyhow limit me to have udev tmpfs so high quota when my main/largest LVM volume will need more disk space in future?
Neither udev nor tmpfs use physical disk space, so they don't care about LVM or file system partitions or anything like that.

Furthermore, there is no compelling reason to change the size limits on them. They only consume as much RAM as is required to fit their current contents, plus a puny overhead. The default size limits are already overkill for what they will use in practice, so just let it be.

Quote:
Would be wise to convert everything to LVM so i can resize them easily in future? Here is mentioned that it may not be good idea to convert root partition into LVM.
Right now, there's just one file system partition - the root partition. It is indeed a bad idea to try and resize or convert the root partition while it is the root partition. If you want to change it around, you'll have to do while booted up to a different partition or a LiveCD or an install disc or something (like my RAMBOOT technique). Also, unless you really know what you're doing you'll probably need to reinstall the OS because you won't know the ins and outs of how to reflect the changes in the OS set up and boot loader.
Quote:
I see i can use "fdisk /dev/sda" to change /dev/sda1 type from Linux to Linux LVM.
But when reading this page, i am unsure if this LVM change in fdisk is all what i need to do, if i do not need to install some LVM software. apt-get install lvm2 says:
The following NEW packages will be installed:
dmeventd libdevmapper-event1.02.1 liblvm2app2.2 liblvm2cmd2.02 libreadline5 lvm2
Also there is LVM2. What is a difference between Linux LVM type created by fdisk and lvm2 installed by "apt-get install lvm2" ? Thank You for advises what is needed to convert my setup to LVM.
Converting your setup to LVM would be a very complex process. Since this is a fresh system, the best way to do it would be to completely reinstall from scratch, using the Debian 9 install disc. Even then, the way the Debian installer handles LVM is not the most intuitive thing. Basically, you'll want to:

1) Boot into the install disc ... when it gets to the partitioning set up...

2) Choose manual partitioning

3) Remove the existing partitions

4) Create an LVM volume for the entire disc (assuming you don't want a separate /boot partition)

5) Go to the LVM submenu (this is the part that's not intuitive! You have to go to a submenu to actually make partitions in the LVM volume)

6) Create partitions within the LVM volume as desired ... I don't really know what you want, but one big OS partition is an option.

The benefits of this, though? Minimal or nonexistent. LVM makes sense if you want to have lots of different partitions and/or lots of different drives and you want the flexibility to use LVM tools to combine/resize/etc those partitions. But it's never a good idea to muck around with your OS partition while you're booted up to it, so you can't really do much with LVM when you've only got one partition anyway.

Unless you have a specific reason to use LVM, I'd say don't bother.
 
1 members found this post helpful.
Old 07-08-2017, 06:34 AM   #7
postcd
Member
 
Registered: Oct 2013
Posts: 527

Original Poster
Rep: Reputation: Disabled
Thank You for detailed explanation.
"df -h" shows that the root partition (/dev/sda1) size is "484G" while "fdisk -l" shows total disk size "556G"
So why i am concerned about tmpfs and udev "partitions" size is that i want to store as much data as possible on /dev/sda1.
Can i claim disk space from tmpfs/udev somehow so the OS will alow me to store more data on the /dev/sda1? (i see total disk space is 556G and only 484G is alocated to /dev/sda1 ...).
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stretch Wayland and NVIDIA Support VisionIncision Debian 2 05-04-2017 10:03 AM
LXer: Debian GNU/Linux 9 "Stretch" to Drop Support for the PowerPC (PPC) Architecture LXer Syndicated Linux News 0 11-01-2016 05:34 AM
LUKs and LVM Advice on Partitioning Method UbuntuRR Linux - Newbie 1 02-11-2016 04:18 PM
Seeking advice on Desktop Manager with touch screen and light support (Debian on ARM 11 667MHz CPU) newuser10 Linux - Newbie 0 04-09-2012 01:01 PM
Debian w/ KDE 3.3.2: setting default programs, and mp3 support audiorevolution Linux - Newbie 1 06-03-2005 09:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:15 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