LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2017, 06:56 PM   #1
sryzdn
Member
 
Registered: Feb 2013
Posts: 274

Rep: Reputation: 9
How to add hardware empty space to fedora?


Hi,

I have dual boot system, windows and fedora 26. I have shrunk one of windows partitions for about 20Gb. But, I do not know how to extend my linux hardware capacity using this unallocated empty space.

Any help would be greatly appreciated.
 
Old 08-24-2017, 07:22 PM   #2
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Post the result of
Code:
sudo parted /dev/sda "print free"
 
Old 08-24-2017, 07:27 PM   #3
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
And
Code:
lsblk -f
 
Old 08-24-2017, 08:10 PM   #4
sryzdn
Member
 
Registered: Feb 2013
Posts: 274

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by TxLonghorn View Post
Post the result of
Code:
sudo parted /dev/sda "print free"
Here it is:

Quote:
Code:
Number  Start   End     Size    Type      File system  Flags
        32.3kB  1049kB  1016kB            Free Space
 1      1049kB  106MB   105MB   primary   ntfs         boot
 2      106MB   224GB   224GB   primary   ntfs
        224GB   224GB   8225kB            Free Space
 3      224GB   346GB   122GB   primary   ntfs
        346GB   367GB   21.0GB            Free Space
 4      367GB   500GB   133GB   extended
 5      367GB   368GB   1074MB  logical   ext4
 6      368GB   500GB   132GB   logical                lvm
        500GB   500GB   24.6kB            Free Space

Last edited by sryzdn; 08-24-2017 at 08:11 PM.
 
Old 08-24-2017, 09:21 PM   #5
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
It would be fairly complicated to merge that free space into your linux OS.
It is more complicated by the fact that your linux is lvm.
The normal procedure would be to boot a live USB or DVD and use Gparted. Unmount the 2 logical partitions, sda5 and sda6
You could then increase the size of the extended partition, sda4, and then expand sda6.
You have to be prepared to repair your bootloader - there is a good chance it will fail after that operation.
As I said, that is the normal procedure, but I am not very familiar with lvm, and I don't know if there are special steps you have to take with that...
 
Old 08-25-2017, 12:48 AM   #6
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
What about the data I asked for in post #3 ?.
The general scenario would be to increase the extended partition to consume that space, create a partition, pvcreate then add it to the vg then lv. After that resize the appropriate filesystem. None of the names are known to us.

Last edited by syg00; 08-25-2017 at 12:53 AM. Reason: typo
 
Old 08-25-2017, 01:55 AM   #7
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
OR, you could partition the free space and mount it at /var or /usr. You'd have to copy all the data over. My /usr is using 36GB, so 24GB in none too much. But my system needs a bit of maintenance. I'm glad your post got me to look at my /usr usage.
 
Old 08-25-2017, 07:54 AM   #8
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
LVM is easily the best way to do this. As has been described, first you create "pv's" corresponding to the partitions that you want LVM to be able to dole out. Then, you create "lv's" that consume space from one or more of them. The file system will not perceive that the data is coming from more than one physical area: with LVM, a mount-point no longer corresponds to a physical thing and is no longer confined to that one thing. When the time comes that you need more space (and, it will ...), you can map more space and you don't even have to reboot to do it.
 
Old 08-25-2017, 02:18 PM   #9
sryzdn
Member
 
Registered: Feb 2013
Posts: 274

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by syg00 View Post
What about the data I asked for in post #3 ?.
The general scenario would be to increase the extended partition to consume that space, create a partition, pvcreate then add it to the vg then lv. After that resize the appropriate filesystem. None of the names are known to us.
Truth is, I just had the result of uuid and all those hex numbers got me thinking that may not be safe to put them all out in the internet, and I didn't find time to read what they really are. So, I just did not send the info.
 
Old 08-25-2017, 02:19 PM   #10
sryzdn
Member
 
Registered: Feb 2013
Posts: 274

Original Poster
Rep: Reputation: 9
Quote:
Originally Posted by sundialsvcs View Post
LVM is easily the best way to do this. As has been described, first you create "pv's" corresponding to the partitions that you want LVM to be able to dole out. Then, you create "lv's" that consume space from one or more of them. The file system will not perceive that the data is coming from more than one physical area: with LVM, a mount-point no longer corresponds to a physical thing and is no longer confined to that one thing. When the time comes that you need more space (and, it will ...), you can map more space and you don't even have to reboot to do it.
I have no idea how LVM can do this. I will search the internet to learn how to work with LVM.
 
Old 08-25-2017, 05:14 PM   #11
sryzdn
Member
 
Registered: Feb 2013
Posts: 274

Original Poster
Rep: Reputation: 9
So... what I have done so far is that I installed a free partition tool on windows and moved the unallocated space to the right side of my linux partitions. Then I installed "Gparted" on linux and I tried to resize my /dev/sda6 but it is locked and thought the empty space is just on the right side of it I cannot merge them.

Any ideas is greatly appreciated.
 
Old 08-25-2017, 08:00 PM   #12
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
Quote:
Originally Posted by sryzdn View Post
I have no idea how LVM can do this. I will search the internet to learn how to work with LVM.
Here's a nice website that I just found ... https://siva2009.wordpress.com/2010/...tend-commands/

The opening paragraph sets the stage very well:
Quote:
With LVM, we can create logical partitions that can span across one or more physical hard drives. First, the hard drives are divided into physical volumes, then those physical volumes are combined together to create the volume group and finally the logical volumes are created from volume group.
It's important to remember that Linux recognizes partition-tables and automatically assigns numbers to each. So, in the example cited on the page: pvcreate /dev/sda6 would refer to the sixth partition in the first (sda) hard drive.

So, to put it another way:
  1. You define the partitions that can be used for allocation.
  2. You bundle these into a physical volume group.
  3. You create logical volumes from those physical groups.
It is a supremely-flexible system which insulates the operating system (which sees a logical view) from the physical storage setup which furnishes resources to that logical view. The operating system perceives contiguous, uninterrupted space, never knowing that it came from multiple physical places. "Schweet!!"
 
Old 08-25-2017, 08:29 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
As others have posted /dev/sda6 is a logical partition which "resides" inside the extended partition /dev/sda4. You can not resize sda6 since there is no more empty space within the extended partition.

Resize /dev/sda4 to include the empty space that exists on the "right side"

Typically Fedora automatically creates a VG with a root and swap LV that reside within the PV i.e /dev/sda6. That would of been apparent if you posted the info as requested by syg00.

Once you resize /dev/sda4 you can as suggested create another partition as a PV and add that space to your existing vg/root LV or resize the root vg/lv to include the newly added space. The first might be slightly easier.

while gparted can manipulate the PV you still need to use command line tools to handle the volume group/logical volume stuff.
 
Old 08-26-2017, 01:25 PM   #14
DVOM
Member
 
Registered: Nov 2010
Posts: 223

Rep: Reputation: 48
Quote:
Originally Posted by sryzdn View Post
So... what I have done so far is that I installed a free partition tool on windows and moved the unallocated space to the right side of my linux partitions. Then I installed "Gparted" on linux and I tried to resize my /dev/sda6 but it is locked and thought the empty space is just on the right side of it I cannot merge them.

Any ideas is greatly appreciated.

The reason you can't do anything with sda6 is you have it mounted. Because you're using it. I suggest DLing gparted by itself and put it on a bootable USB. Boot to that and you'll be able to deal with it.
 
Old 08-26-2017, 09:34 PM   #15
tofino_surfer
Member
 
Registered: Aug 2007
Posts: 483

Rep: Reputation: 153Reputation: 153
Quote:
So... what I have done so far is that I installed a free partition tool on windows and moved the unallocated space to the right side of my linux partitions. Then I installed "Gparted" on linux and I tried to resize my /dev/sda6 but it is locked and thought the empty space is just on the right side of it I cannot merge them.

Any ideas is greatly appreciated.
Now that you have moved the free space around can you post again the output of the following commands

Code:
sudo parted /dev/sda "print free"
sudo fdisk -l /dev/sda
lsblk -f /dev/sda
As others have said it may be easier to create a new partition in the empty space, format it as an LVM PV and then add it to your existing VG. You don't need a bootable GParted for that.
 
  


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
LXer: ADD Swap Space on Linux Servers (CentOS / RHEL / Fedora / Ubuntu) On the Fly LXer Syndicated Linux News 0 05-27-2013 12:40 AM
[SOLVED] add more HD space to my Fedora machine VicRic Linux - Newbie 5 08-30-2011 12:59 AM
how to zero empty disk space alenD Linux - Hardware 7 12-21-2007 03:14 PM
dd empty space question ygloo Linux - Software 15 09-22-2006 12:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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