0

I added 6GB of memory on an older Dell PowerEdge 1850 that we use just for backups to an attached hardware RAID from Promise Technology called a VessRAID connected by iSCSI. After a few weeks I noticed the swap space was only 2 GB and decided to resize the home partition and add 6GB to swap.

I followed the steps to Extend Swap on an LVM2 Logical Volume. On reboot I got to emergency mode and the dreaded and "Either the superblock or the partition table is likely to be corrupt!". I also see failed to find cpu0 device node error. The server is on the 4.9.3 kernel. Is my best bet still to try mke2fs with or without the -S option as suggested here? I also tried the resize2fs command but I get "Device or resource busy while trying to open /dev/sdb"

Not sure if it's related but here are some other errors I was seeing in the logs before reboot:

Jan 19 20:06:00 curie systemd-logind: Removed session 156.
Jan 19 20:14:56 curie systemd: Failed to set up mount unit: Device or resource busy
Jan 19 21:10:18 curie systemd: local-fs.target: Cannot add dependency job, ignoring: Unit home.mount is masked.
Jan 19 21:11:14 curie systemd: local-fs.target: Cannot add dependency job, ignoring: Unit -.mount is masked.

/etc/fstab has this:

/dev/mapper/vg_curie-lv_root /                       ext4    defaults        1 1
UUID=e3507fa1-f9ee-4951-8ecc-48f16183dee9 /boot                   ext4    defaults        1 2
/dev/mapper/vg_curie-lv_home /home                   ext4    defaults        1 2
/dev/mapper/vg_curie-lv_swap swap                    swap    defaults        0 0
RobbieTheK
  • 390
  • 5
  • 15
  • You wrote :"decided to resize the home partition and add 6GB to swap" What did you do to resize your home partition? To shrink a partition you have to shrink the filesystem first and the partition later. – Uwe Burger Jan 21 '17 at 18:51
  • So you would have to: 1. (as root user) umount /dev/mapper/vg_curie-lv_home /home 2. fsck -f /dev/mapper/vg_curie-lv_home /home 3. resize2fs /dev/mapper/vg_curie-lv_home /home NEW_SIZE 4. lvresize -L NEW_SIZE /dev/mapper/vg_curie-lv_home /home – Uwe Burger Jan 21 '17 at 18:57
  • 1
    try vgcfgrestore to restore your home volume from /etc/lvm/archive – Uwe Burger Jan 21 '17 at 19:01
  • But I already did the resize using these commands from the Fedora link: `Disable swapping for the associated logical volume: swapoff -v /dev/mapper/vg_curie-lv_swap swap Resize the LVM2 logical volume by 6GB: lvresize /dev/mapper/vg_curie-lv_home -L -6GB lvresize /dev/mapper/vg_curie-lv_swap -L +6GB Format the new swap space: mkswap /dev/mapper/vg_curie-lv_swap Enable the extended logical volume: swapon -v /dev/mapper/vg_curie-lv_swap swap` – RobbieTheK Jan 21 '17 at 19:16
  • 1
    The instructions you linked show how to _expand_ a logical volume, not how to _shrink_ one. You have destroyed your filesystem. Now you have to restore from backup. – Michael Hampton Jan 21 '17 at 20:58
  • The title of the link says Extend Swap. In the other link I have there's a mention of mke2fs I just want to know if I should use -S or not with ext4 – RobbieTheK Jan 21 '17 at 21:10
  • Please post from the output of history exactly what you did – Uwe Burger Jan 22 '17 at 07:51
  • swapoff -v /dev/mapper/vg_curie-lv_swap lvresize /dev/mapper/vg_curie-lv_swap -L +2G lvresize /dev/mapper/vg_curie-lv_home -L -4G lvresize /dev/mapper/vg_curie-lv_swap -L +4G mkswap /dev/mapper/vg_curie-lv_swap swapon -v /dev/mapper/vg_curie-lv_swap – RobbieTheK Jan 25 '17 at 14:24

1 Answers1

0

Well I got lucky. These commands seem to have worked!

mkfs.ext4 -S /dev/mapper/vg_curie-lv_home 
e2fsck -f -y /dev/mapper/vg_curie-lv_home 

The fsck took a couple of hours but it came back with all errors fixed and a reboot worked!

RobbieTheK
  • 390
  • 5
  • 15