Jump to content

How to re-format and remount and redo LVM volume on SSD


kkdao

Recommended Posts

I followed a guide to install a system on my Rockpro64 but something happened where I had to reinstall it. However, when I reflashed the ubuntu server image and tried re-installing the system it got an error pertaining to one of my disk volumes. So I'm wondering how to re-format and remount and redo the LVM volume my SSD.

Any help or tips would be greatly appreciated!

Link to comment
Share on other sites

You could do something like dd if=/dev/zero of=/dev/nvme0 bs=512 count=1 where nvme0 should be the device itself and not the first partition. You can verify this beforehand with fdisk -l. After that you may have to restart the board to make the "new" partition table recognized.

 

Link to comment
Share on other sites

Okay I will try that thanks, but just to clarify what are you referring to that I can verify beforehand? Because when I do 'fdisk -l' I see that it says nvme0n1 not nvme0.

Alright though I will keep in mind that I may have to restart.

Link to comment
Share on other sites

29 minutes ago, kkdao said:

 nvme0n1 not nvme0.

I wasn't sure about that because it looked to me that nvme0 is the device itself and n1 is the first partition but maybe there was not partition on it beforehand...

Link to comment
Share on other sites

i see the disk there at the top of the output but not sure what to look for as it seems like there is still space on it, i see:

Disk /dev/nvme0n1: 953GB, 1024209543168 bytes, 2000409264 sectors
Disk model: Sabrent
Units: sectors of 1 * 512 = 512 bytes

Sector size (logical/physical): 512 bytes / 512 bytes

I/O size (minimum/optimal): 512 bytes / 512 bytes

Link to comment
Share on other sites

Disk /dev/nvme0n1: 953.89 GiB, 1024209543168 bytes, 2000409264 sectors
Disk model: Sabrent                                 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mtdblock0: 16 MiB, 16777216 bytes, 32768 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mmcblk2: 14.46 GiB, 15518924800 bytes, 30310400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x0ca53e42

Device         Boot Start      End  Sectors  Size Id Type
/dev/mmcblk2p1      32768 30007295 29974528 14.3G 83 Linux


Disk /dev/zram0: 50 MiB, 52428800 bytes, 12800 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/zram1: 1 GiB, 1073741824 bytes, 262144 sectors
Units: sectors of 1 * 4096 = 4096 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/rockpro64-project: 500 GiB, 536870912000 bytes, 1048576000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Link to comment
Share on other sites

specifically how to remount, because I tried installing the system again, but I get a mount error:

rockpro64 systemd[1]: var-lib-bitcoind.ount: Job var-lib-bitcoind.mount/start failed with result 'dependency'

Edited by kkdao
Link to comment
Share on other sites

I've actually tried re-flashing the eMMC with Etcher (which is what I'm using instead of SD card) with a new image of the Ubuntu OS, but I still get errors when trying to run the system again. After looking deeper into the errors I have figured out there is an issue with my drive still being mounted somehow. So when I do 'e2fsck -f /dev/nvme0n1' or 'fsck.ext4 /dev/nvme0n1' I get back:

ext2fs_open2: bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/nvme0n1

 

The superblock could not be read or does not describe a valid ext2/ext3/ext4 filesystem. If the device is valid and it really contains an exy2/ext3/ext4 filesystem (and not swap or ufs or something else), then the superblock is corrupt, and you might try running e2fsck with an alternate superblock:

e2fsck -b 8193 <device>

or

e2fsck -b 32768 <device>

 

but when I try running e2fsck with the suggested alt superblock i get:
/dev/nvme0n1 contains a LVM2_member file system

I did all this in root FYI (sudo -) after SSHing into my system.

 

Another thing I probably should've mentioned at the beginning was WHY this all occurred in the first place and it's because I accidentally unplugged the power cord from the outlet while the system was on and running. So that's why the mount point is somehow messed up seemingly.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines