Can't mount LVM partition after resizing

asked 2015-12-23 11:47:44 -0500

Alexandre1545 gravatar image

After shrinking my LVM partition, I can't mount it.

mount -t ext4 /dev/fedora/home /mnt

mount: mauvais type de système de fichiers, option erronée, superbloc erroné
    sur /dev/mapper/fedora-home, page de code ou programme auxiliaire manquant, ou autre erreur

    Dans certains cas des renseignements utiles sont dans le journal
    système — essayez « dmesg | tail » ou quelque chose du genre.

Running fsck give me this

fsck /dev/fedora/home fsck -b 32768 /dev/fedora/home

fsck de util-linux 2.27.1
e2fsck 1.42.13 (17-May-2015)
La taille du système de fichiers (selon le superbloc) est de 226678784 blocs
La taille physique du périphérique est de 160575488 blocs
Le superbloc ou la table des partitions est peut-être corrompue !

Is there a way to get my partition in a state where I can mount it ?

edit retag flag offensive close merge delete

Comments

Did you run resize2fs after resizing it?

aeperezt gravatar imageaeperezt ( 2015-12-23 14:57:33 -0500 )edit

no, this is what i get trying to run it:

resize2fs /dev/fedora/home

resize2fs 1.42.13 (17-May-2015) En train de redimensionner le système de fichiers sur /dev/fedora/home à 160575488 (4k) blocs. resize2fs: Ne peut lire un bitmap de blocs lors de la tentative de changement de taille de /dev/fedora/home Veuillez lancer « e2fsck -fy /dev/fedora/home » pour corriger le système de fichiers après l'opération de changement de taille avortée.

Alexandre1545 gravatar imageAlexandre1545 ( 2015-12-23 15:29:52 -0500 )edit

it is telling you to use the switch -fy but I cannot read french but looks like there is an error so not sure what need to be done

aeperezt gravatar imageaeperezt ( 2015-12-23 23:08:09 -0500 )edit

What are the exact steps you followed ? Seems only a part has been done. After resize2fs, you need to run lvreduce. Futhermore, if you shrink to much the partition, e2fsck will complain, need to iterate to find the right size with lvextend. Can give you my notes when I did it.

yolo gravatar imageyolo ( 2015-12-24 08:08:15 -0500 )edit

Thanks to all, like you pointed out, the manipulation was not done correctly, but finally I was able to revert the change back.

pvresize /dev/sda3
lvresize -l +100%FREE fedora/home

Now i'm able to mount my partition and read the content.

Alexandre1545 gravatar imageAlexandre1545 ( 2015-12-24 08:50:13 -0500 )edit