Linux - GeneralThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to recover a bricked Fedora upgrade. fdisk -l from rescue gives me this (in part):
Quote:
Disk /dev/mapper/vg_cpe--76--178--212--156-lv_root
Disk /dev/mapper/vg_cpe--76--178--212--156-lv_home
Disk /dev/mapper/vg_cpe--76--178--212--156-lv_swap
I want to format everything but the /home portion. What would be the command for accomplishing this? BTW, this is an LVM partition.
I'm trying to recover a bricked Fedora upgrade. fdisk -l from rescue gives me this (in part):
Code:
Disk /dev/mapper/vg_cpe--76--178--212--156-lv_root
Disk /dev/mapper/vg_cpe--76--178--212--156-lv_home
Disk /dev/mapper/vg_cpe--76--178--212--156-lv_swap
I want to format everything but the /home portion. What would be the command for accomplishing this? BTW, this is an LVM partition.
Looks like LVM, yes. Do you see the volume group? The vgs command should show it. Let's assume you do see it.
Do you want to reformat the logical volumes or do you want to remove them?
In the former case, mkfs <volume name as above>
In the latter case, lvremove <volume name as above>. Then you can use the space that was freed for other things.
Alternative: Mount the home volume, backup everything on it, and repurpose the entire disk, for example pvcreate -ff (from memory).
Looks like LVM, yes. Do you see the volume group? The vgs command should show it. Let's assume you do see it.
Do you want to reformat the logical volumes or do you want to remove them?
In the former case, mkfs <volume name as above>
In the latter case, lvremove <volume name as above>. Then you can use the space that was freed for other things.
Alternative: Mount the home volume, backup everything on it, and repurpose the entire disk, for example pvcreate -ff (from memory).
Thanks. So would this be the proper command if I I wanted to format the /root section?
Or, do I have to format/remove the entire group using the group number (vg_cpe-76-178-212-156)? If I have to remove the entire group, then we're talking a fresh install.
Not sure I'd play too much with fdisk and for sure not trying to fix a system from rescue but formatting.
I might be tempted to first remove/copy /home off using a live media. Then install as you wish.
It may be possible that some distro's know that you want to upgrade and it may try to keep /home correctly.
If you want to save data then make a backup now.
The Fedora distribution seems to be broken when trying to rescue, particularly LVM partitions. It is supposed to (according to the Fedora documentation) allow you to install over the old /root from the live media. However, all it does is try to use free space in the partition to create another one to install on.
BTW, the problem occurred when updating from Fedora 23 to 24. The kernel is 4.55-300.fc24.x86_64.
I see I assumed too much. You really did mean format.
A few linux distro's make it kind of a hassle to install over a broken system I agree. You end up having to get rid of the old install fully sometimes.
If you simply want to get rid of the LVM structures on that disk, try
Code:
pvremove -ff /dev/whateverdevice
where whateverdevice is the disk device on which your logical volumes reside. Something like /dev/sdc1. If you don't know what it might be, use lsblk to find out. For example:
Code:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 53.3G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 52.8G 0 part
├─centos-root 253:0 0 33.3G 0 lvm /
├─centos-swap 253:1 0 3.1G 0 lvm [SWAP]
└─centos-home 253:2 0 16.3G 0 lvm /home
sr0 11:0 1 1024M 0 rom
shows that logical volumes centos-root, centos-swap and centos-home are on /dev/sda2.
Note that the -ff option is dangerous: If you provide the wrong device, you risk destroying important data.
If you simply want to get rid of the LVM structures on that disk, try
Code:
pvremove -ff /dev/whateverdevice
where whateverdevice is the disk device on which your logical volumes reside. Something like /dev/sdc1. If you don't know what it might be, use lsblk to find out. For example:
Code:
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 53.3G 0 disk
├─sda1 8:1 0 500M 0 part /boot
└─sda2 8:2 0 52.8G 0 part
├─centos-root 253:0 0 33.3G 0 lvm /
├─centos-swap 253:1 0 3.1G 0 lvm [SWAP]
└─centos-home 253:2 0 16.3G 0 lvm /home
sr0 11:0 1 1024M 0 rom
shows that logical volumes centos-root, centos-swap and centos-home are on /dev/sda2.
Note that the -ff option is dangerous: If you provide the wrong device, you risk destroying important data.
So in your example, would you have to remove all of sda2, or could you just remove centos-root?
The Fedora distribution seems to be broken when trying to rescue, particularly LVM partitions. It is supposed to (according to the Fedora documentation) allow you to install over the old /root from the live media. However, all it does is try to use free space in the partition to create another one to install on.
Very unlikely. More likely you don't understand the process, which admittedly isn't that intuitive.
I just tested F21 install (all I had handy) on a Mint 17 machine that had root and swap on LVM in a LUKS container. Anaconda found the separate EFI and /boot standard partitions as well as an "Unknown". Expanding the "Unknown" showed the LUKS container which it requested the passphrase for. From there I was able to resize both root and swap - note I couldn't rename the vg or lv; probably because they were active. No big deal for me as I wasn't proceeding with the install - but the re-partitioning was accepted.
Very unlikely. More likely you don't understand the process, which admittedly isn't that intuitive.
I just tested F21 install (all I had handy) on a Mint 17 machine that had root and swap on LVM in a LUKS container. Anaconda found the separate EFI and /boot standard partitions as well as an "Unknown". Expanding the "Unknown" showed the LUKS container which it requested the passphrase for. From there I was able to resize both root and swap - note I couldn't rename the vg or lv; probably because they were active. No big deal for me as I wasn't proceeding with the install - but the re-partitioning was accepted.
Well, then please go over to the Fedora thread I've got going and resolve it within Anaconda. So far, no one there has been able to figure it out and the documentation hasn't even been written yet for this feature. But I'm not interested in Anaconda here, I'm looking for a generic Linux solution.
I had no problem making the Fedora 24 installer reformat the swap and root LVs while leaving home alone.
On the INSTALLATION DESTINATION screen, select "I will configure partitioning", then click on "Done".
On the MANUAL PARTIONING screen, below where it says "Or, assign new mount points to existing partitions after selecting them below," click on the "Fedora Linux ..." partition.
Select /home, set the mount point as "/home".
Select /, set the mount point to "/" and put a tic in "Reformat".
Select swap, put a tic mark in "Reformat", then click on "Update Settings"
Click on "Done".
In the "SUMMARY OF CHANGES" verify that fedora-swap and fedora-root will be reformatted, then click on "Accept Changes".
Then let the installation begin. I suggest that any user you create should use a numeric UID different from the one that already exists in /home.
I had no problem making the Fedora 24 installer reformat the swap and root LVs while leaving home alone.
On the INSTALLATION DESTINATION screen, select "I will configure partitioning", then click on "Done".
On the MANUAL PARTIONING screen, below where it says "Or, assign new mount points to existing partitions after selecting them below," click on the "Fedora Linux ..." partition.
Select /home, set the mount point as "/home".
Select /, set the mount point to "/" and put a tic in "Reformat".
Select swap, put a tic mark in "Reformat", then click on "Update Settings"
Click on "Done".
In the "SUMMARY OF CHANGES" verify that fedora-swap and fedora-root will be reformatted, then click on "Accept Changes".
Then let the installation begin. I suggest that any user you create should use a numeric UID different from the one that already exists in /home.
Thank you so much for the great directions rknichols! They were a little different than how I'd tried it in the past on Anaconda, but unfortunately I get the same problem. Everything looks good as I'm doing it. When I press "Done," it goes back to the first screen and has the error message:
Quote:
Not enough space in file systems for the current selection. An additional 4.8 g is needed
So, when I go back to the Manual partitioning screen, it has changed the root partition to 500 M. From the numerous times over the last two weeks I've tried to use Anaconda, I've discovered that 500 M is what is not currently allocated on that disk. Even if I specify 36 G (which is the space in the /root partition), it refuses to use it. This is why that I'm looking here for a way to reformat the /root outside of Anaconda, then hope Anaconda will allow the install on /root.
Thank you so much for the great directions rknichols! They were a little different than how I'd tried it in the past on Anaconda, but unfortunately I get the same problem. Everything looks good as I'm doing it. When I press "Done," it goes back to the first screen and has the error message:
I don't know what is happening, then. I did a Fedora 23 install creating a disk with 1 30G LVM partition containing 3 LVs (12G root, 15G home, 3G swap), then ran the Fedora 24 installer using the steps I described above. It all worked just fine, and I was greeted with a fresh installation with a /home that still held the home directory for the original user. Perhaps whatever is wrong is what bricked your F24 upgrade in the first place.
That "500 GB" sounds like your root partition is getting confused with your separate /boot partition (which I did not use). Is your disk GPT? Mine was MBR partitioned; perhaps that's the difference.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.