Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
2 answers
2474 views
Partitions not visible while dual booting Kali with Windows 11 with GPT disk
While trying to install Kali Linux as a secondary OS with Windows 11(primary OS), the partition created for Kali is not visible during the Graphical Install. The hard drive I'm trying to install kali on is of size 1 TB. Even after making a partition of 150 GB, the disk partition menu in the graphica...
While trying to install Kali Linux as a secondary OS with Windows 11(primary OS), the partition created for Kali is not visible during the Graphical Install. The hard drive I'm trying to install kali on is of size 1 TB. Even after making a partition of 150 GB, the disk partition menu in the graphical install of kali is not showing the partitions rather showing the disk with one partition of size 932 GB Upon initial research, I tried fixing the partition table using gdisk (since my system has GPT disks), but that didn't help. Primary OS: Windows 11 Disk Type: GPT Image Used: kali-linux-2021.4a-installer-amd64 **EDITED:** Disk Management: enter image description here Partition Not Visible: enter image description here
ayush7ad6 (1 rep)
Jan 20, 2022, 09:17 PM • Last activity: Jul 1, 2025, 05:07 PM
1 votes
2 answers
9113 views
How do you erase the partition TABLE of a drive?
New(ish) to Linux, not new to hardware. Got a new NAS which is to be hosted via linux. Before that I'm faffing about with the hardware, and things I will never get to do otherwise. Live distros are so lovely. I've tried around 4 so far. Anyway, I'm also playing around with the storage drives. There'...
New(ish) to Linux, not new to hardware. Got a new NAS which is to be hosted via linux. Before that I'm faffing about with the hardware, and things I will never get to do otherwise. Live distros are so lovely. I've tried around 4 so far. Anyway, I'm also playing around with the storage drives. There's a bunch of file systems and partition types to explore - swap partitions are a puzzling idea to me, but whatever. I can play around with those easy enough. However I could not find a way to actually delete the partition **TABLE**, just change it. I tried both fdisk and gparted. How do you delete the partition table?
martixy (123 rep)
May 1, 2023, 05:38 AM • Last activity: Jun 26, 2025, 11:04 PM
5 votes
3 answers
1095 views
Is there a scriptable way to identify the nth partition of a disk?
Suppose I have a disk located at `/dev/DISK_NAME`. I'm curious if there is a command to find the `n`th partition of this disk. It seems like this sort of thing should be possible with `lsblk`. The best I can come up with is: lsblk -nlpo NAME,TYPE /dev/DISK_NAME | awk '/part$/ {print $1}' | grep "[^0...
Suppose I have a disk located at /dev/DISK_NAME. I'm curious if there is a command to find the nth partition of this disk. It seems like this sort of thing should be possible with lsblk. The best I can come up with is: lsblk -nlpo NAME,TYPE /dev/DISK_NAME | awk '/part$/ {print $1}' | grep "[^0-9]n$" Here, the n in the last grep represents the partition number in question. The command above works for the arch linux machine I'm currently on, where DISK_NAME=sda and the output of lsblk -nlpo NAME,TYPE is /dev/sda disk /dev/sda1 part /dev/sda2 part /dev/sda3 part /dev/sda5 part My command also works on my arch linux machine where DISK_NAME=nvme0n1 and the output of lsblk -nlpo NAME,TYPE is /dev/nvme0n1 disk /dev/nvme0n1p1 part /dev/nvme0n1p2 part Still, this feels rather hacky, and I'm not sure if it would work on an arbitrary disk. Are there better ways to do this?
Brian Fitzpatrick (2907 rep)
Jun 11, 2021, 05:16 PM • Last activity: Jun 25, 2025, 11:39 AM
0 votes
1 answers
2173 views
how to create boot partition on nonpartitioned disk?
how to create boot partition on new nonpartitioned disk? UEFI boot,for Linux, single OS on disk. Preferably using GParted.
how to create boot partition on new nonpartitioned disk? UEFI boot,for Linux, single OS on disk. Preferably using GParted.
Lexx Luxx (1463 rep)
Dec 10, 2020, 02:36 PM • Last activity: Jun 23, 2025, 10:02 AM
2 votes
1 answers
2159 views
Change filesystem type from "Linux" to "Linux root (x86-64)"
I just partitioned a new GUID drive, and accidentally chose "Linux filesystem" (`0FC63DAF-8483-4772-8E79-3D69D8477DE4`) instead "Linux root (x86-64)" (`4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709`) for my root partition. I already downloaded and installed the system. Is it possible to change the partition...
I just partitioned a new GUID drive, and accidentally chose "Linux filesystem" (0FC63DAF-8483-4772-8E79-3D69D8477DE4) instead "Linux root (x86-64)" (4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709) for my root partition. I already downloaded and installed the system. Is it possible to change the partition type without reinstalling/repartitioning?
friederbluemle (211 rep)
Nov 26, 2019, 07:40 AM • Last activity: Jun 12, 2025, 02:08 PM
0 votes
0 answers
874 views
USB drive is not recognized due to a failed partition formatting
I created a encrypted partition on my Kingston USB drive (`/dev/sda`) using VeraCrypt. I was trying to format the partition using GNOME Disk Utility after mounted the partition using VeraCrypt (`/dev/sda2` -> `/dev/mapper/veracrypt1` -> `/mnt/crypt`), but I got an error. Now, my USB drive is not rec...
I created a encrypted partition on my Kingston USB drive (/dev/sda) using VeraCrypt. I was trying to format the partition using GNOME Disk Utility after mounted the partition using VeraCrypt (/dev/sda2 -> /dev/mapper/veracrypt1 -> /mnt/crypt), but I got an error. Now, my USB drive is not recognized by my computer (runs PopOS 22.04 LTS and Windows 11). GNOME Disk Utility show a device /dev/sda with no size. Command df, fdisk, testdisk, dd, fsck, e2fsck can not find the medium /dev/sda. Command lsblk found the device sda, but size is 0:
NAME          MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINTS
loop0           7:0    0   173M  0 loop  /run/wine
sda             8:0    1     0B  0 disk  
nvme0n1       259:0    0   1.9T  0 disk  
├─nvme0n1p1   259:1    0   512M  0 part  
├─nvme0n1p2   259:2    0    16M  0 part  
├─nvme0n1p3   259:3    0   100G  0 part  
├─nvme0n1p4   259:4    0   100G  0 part  
├─nvme0n1p5   259:5    0 193.1G  0 part  /
├─nvme0n1p6   259:6    0   1.5T  0 part  /mnt/evil
└─nvme0n1p7   259:7    0     8G  0 part  
  └─cryptswap 252:0    0     8G  0 crypt [SWAP]
Command sudo dmesg | tail output this:
[16040.588575] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[16040.588585] usb 2-1: Product: USB DISK 53X            
[16040.588587] usb 2-1: Manufacturer: Phison                  
[16040.589537] usb-storage 2-1:1.0: USB Mass Storage device detected
[16040.590135] scsi host0: usb-storage 2-1:1.0
[16041.608399] scsi 0:0:0:0: Direct-Access     13FE     USB DISK 50X     PMAP PQ: 0 ANSI: 4
[16041.608989] sd 0:0:0:0: Attached scsi generic sg0 type 0
[16041.609425] sd 0:0:0:0: [sda] Media removed, stopped polling
[16041.609972] sd 0:0:0:0: [sda] Attached SCSI removable disk
[16961.241573] workqueue: delayed_fput hogged CPU for >10000us 1024 times, consider switching to WQ_UNBOUND
Command lsusb also found the device:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 011: ID 0b05:18c6 ASUSTek Computer, Inc. N-KEY Device
Bus 003 Device 009: ID 13d3:5492 IMC Networks USB2.0 HD UVC WebCam
Bus 003 Device 007: ID 04f3:0c6e Elan Microelectronics Corp. ELAN:Fingerprint
Bus 003 Device 005: ID 0416:5020 Winbond Electronics Corp. USB Device
Bus 003 Device 003: ID 0c45:636d Microdia USB 2.0 Camera
Bus 003 Device 042: ID 05ac:024f Apple, Inc. Aluminium Keyboard (ANSI)
Bus 003 Device 041: ID 5131:2019 MSR 
Bus 003 Device 040: ID 25a7:fa61 Areson Technology Corp Elecom Co., Ltd MR-K013 Multicard Reader
Bus 003 Device 039: ID 1a40:0801 Terminus Technology Inc. USB 2.0 Hub
Bus 003 Device 002: ID 214b:7250 Huasheng Electronics USB2.0 HUB
Bus 003 Device 012: ID 8087:0033 Intel Corp. 
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 007: ID 13fe:5500 Kingston Technology Company Inc. Flash drive
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 007: ID 13fe:5500 Kingston Technology Company Inc. Flash drive
GUI tools like GParted and DiskGenius can not recognize the device. What should I do now?
Ezra (113 rep)
May 28, 2024, 08:05 AM • Last activity: Apr 5, 2025, 09:51 AM
0 votes
2 answers
89 views
Where does the "Physical size" information come from?
I have an embedded Linux device (not a Raspberry Pi) which has two partitions on an eMMC drive. I have used a vendor-provided tool to copy these two partitions onto a USB drive whose size roughly equals the size of the eMMC drive. What I did next was mount the USB drive onto a Linux computer and use...
I have an embedded Linux device (not a Raspberry Pi) which has two partitions on an eMMC drive. I have used a vendor-provided tool to copy these two partitions onto a USB drive whose size roughly equals the size of the eMMC drive. What I did next was mount the USB drive onto a Linux computer and use tools such as e2fsck and resize2fs -M to resize the second filesystem to a minimum viable size, and finally used gdisk to resize the partition itself to match. In all calculations I've been careful to ensure that the partition does not get smaller than the filesystem, even to a point where I've made the partition slightly larger, and then used resize2fs to enlarge the filesystem to match it. After these operations I have a 16 GB USB drive with a 118 MiB boot partition and a 3.1 GiB root filesystem partition. I then used dd to read data directly from the USB drive, utilizing bs= and count= parameters to limit the amount of data read to only extend up to where the second partition ends plus an extra sector to accommodate the "zero sector". The result is that I now have an image file in which the two partitions have exactly the size of their corresponding sources but when I use the "File" -> "Properties" option of the 7-Zip tool it claims that the "Physical size" (circled in red) is larger than these partitions, and larger than what I instructed dd to copy from the source. Where does this "Physical size" value come from? Is it part of the partition table? Or does dd read it from the disk somehow? Is there any way for me to modify it so as to get rid of the "Unexpected end of data" error? Picture from 7-zip
Antti Keskinen (3 rep)
Sep 23, 2024, 02:37 PM • Last activity: Sep 23, 2024, 08:00 PM
0 votes
1 answers
933 views
creating a bootable usb with GPT partition scheme to make use of linux .iso
The `rhel-8.10-x86_64-dvd.iso` to install from which is 14GB in size. For a usb device (i.e. disk) that would show up in Linux as */dev/sdb* for example, doing a `cp rhel-8.10-x86_64-dvd.iso /dev/sdb` results in an **msdos** partition scheme on that usb device which is bootable and allows you to ins...
The rhel-8.10-x86_64-dvd.iso to install from which is 14GB in size. For a usb device (i.e. disk) that would show up in Linux as */dev/sdb* for example, doing a cp rhel-8.10-x86_64-dvd.iso /dev/sdb results in an **msdos** partition scheme on that usb device which is bootable and allows you to install Linux. *I suspect they use the msdos partition scheme to maintain functionality with older hardware that pre-dates EFI* The msdos partition scheme has a 2TB limit, and poses an inconvenience when I have a 4+ TB usb disk that I want to use simultaneously for being able to install Linux from (which needs [BOOT] AppStream BaseOS EFI images isolinux .discinfo .treeinfo EULA extra_files.json GPL media.repo RPM-GPG-KEY-redhat-beta RPM-GPG-KEY-redhat-release TRANS.TBL is there a way for what I have described to manually do this Linux to make a usb device bootable (using parted or fdisk or some other) ? If so how? Or is there a way with some free software under microsoft windows?
ron (8647 rep)
Jun 13, 2024, 01:27 PM • Last activity: Sep 20, 2024, 05:24 PM
1 votes
1 answers
723 views
How to recover an EXT4 partition from a failed journal
I have a virtual disk that is 86T in size with only 41% used. Th I have an 86T second drive connected to my virtual machine(VM) as /dev/vdb1. The volume is fine, but when I attempt to mount the ext4 partition, the whole machine stops. I left it for more than 24 hours to see if it was just taking a w...
I have a virtual disk that is 86T in size with only 41% used. Th I have an 86T second drive connected to my virtual machine(VM) as /dev/vdb1. The volume is fine, but when I attempt to mount the ext4 partition, the whole machine stops. I left it for more than 24 hours to see if it was just taking a while, but that produced no change. I can boot the VM from it's boot volume so long as I don't attempt any actions on the ext4 partition. I suspected a faulty journal, so I mounted the volume as -o ro,noload. I am able to read data from the drive and interact with the files on the drive. I have attempted to remove the journal by using "e2fsck -O ^has_journal /dev/vdb1" and it responds with "Recovering Journal" and the machine locks up. I have tried booting a gparted ISO, and as soon as any operation is attempted on the ext4 partition, the machine locks up. I did "dumpe2fs /dev/vdb1 | grep -i superblock" it does list Primary and several backup superblocks. It also responds with "dumpe2fs: Block bitmap checksum does not match bitmap while trying to read '/dev/vdb1' bitmaps. Does anyone know how to either remove the needs_recovery or prevent the disk utilities from attempting a journal recovery? Or, better yet, anyone have suggestions for what I can do to get this back online without having to restore massive amounts of data from a backup?
kentt (11 rep)
Jun 30, 2024, 07:54 PM • Last activity: Jul 1, 2024, 04:24 PM
0 votes
0 answers
52 views
SSD partitioning on Linux (data loss)
I wanted to create new partition on SSD (i need it to create disk image using clonezilla). 1. I started from creating while I'm on ssd boot (means the system is running on ssd. Then i got message: ssd in use, may be data loss. 2. I booted from USB, using terminal and fdisk created new 100gb partitio...
I wanted to create new partition on SSD (i need it to create disk image using clonezilla). 1. I started from creating while I'm on ssd boot (means the system is running on ssd. Then i got message: ssd in use, may be data loss. 2. I booted from USB, using terminal and fdisk created new 100gb partition 3. After this i found out that maybe my system was installed on full ssd drive without any partition (because after partition creation i see only one, newly created) 4. Since this i tried to boot from ssd, not from USB, and got message that there is no boot option 5. I booted from usb again, using testdisk find all lost data, but the problem is it cannot be restored So my question is: how is it possible no partition was created while linux installation, what should i do no, is it possible to restore system at all or no? Thanks for you answers and suggestions!
Serafym (11 rep)
Jul 1, 2024, 02:11 PM
1 votes
1 answers
362 views
can msdos partition be located past the 2TB point on a disk?
I have a 5 tb usb disk I use to copy a rhel-8.10.iso file to in order to install Linux. In doing so the copy of that iso to `/dev/sde` creates an msdos partition table. And it creates 2 partitions. I just figured out how to use `fdisk --type=msdos --wipe=never` to create another partition so that I...
I have a 5 tb usb disk I use to copy a rhel-8.10.iso file to in order to install Linux. In doing so the copy of that iso to /dev/sde creates an msdos partition table. And it creates 2 partitions. I just figured out how to use fdisk --type=msdos --wipe=never to create another partition so that I can make an XFSpartition copy data to while preserving the bootable functionality to install RHEL. fdisk recognizes the msdos partition and the 5tb total disk size, and warns in red text about msdos partition and the 2199023255552 limit (2tb). I can create a 3rd and a 4th partition with fdisk ( preserving by bootable rhel8 install partition(s) )... my question is can I create partition #3 of 2TB in size and also a 4th partition also of 2TB in size to make the most out of my 5TB usb disk? Is the msdos partition limit just that a given partition cannot exceed 2TB in **size**, or is it that the msdos partition table cannot **address past** the 2TB point of the disk to where from point 2.0001 TB to *n* TB will always not be usable?
ron (8647 rep)
Jun 12, 2024, 06:39 PM • Last activity: Jun 12, 2024, 09:11 PM
99 votes
3 answers
142955 views
What are the differences between the various partition tables?
When I am looking to create a new partition table, I have the following options: - `aix` - `amiga` - `bsd` - `dvh` - `gpt` - `mac` - `msdos` - `pc98` - `sun` - `loop` The default in gparted appears to be `msdos` which I guess is an 'MBR' partition table. However `gpt` is more recent, but has less Wi...
When I am looking to create a new partition table, I have the following options: - aix - amiga - bsd - dvh - gpt - mac - msdos - pc98 - sun - loop The default in gparted appears to be msdos which I guess is an 'MBR' partition table. However gpt is more recent, but has less Windows support. I've used Linux for a long time, but I've never really looked into partitioning. What are the various options and their differences? Is there a recommended one for Linux-only disks?
user168419
Jun 13, 2016, 06:36 AM • Last activity: Jun 3, 2024, 07:21 PM
1 votes
2 answers
1423 views
Creating disk image with msdos partition table and fat32
I want to create a disk image file to include into my unittests. This disk file should contain a few files afterwards I want to read. When I create a copy of a SD card or a USB stick with `dd` the disk image is quite large, even when I compress it, the size is too large. So I want to create a new di...
I want to create a disk image file to include into my unittests. This disk file should contain a few files afterwards I want to read. When I create a copy of a SD card or a USB stick with dd the disk image is quite large, even when I compress it, the size is too large. So I want to create a new disk image and mount it afterwards. Then adding new data and compressing the disk image for version control My current steps: 1) Create disk image: dd if=/dev/zero of=DISK1.img bs=1M count=1200 2) Open parted: sudo parted DISK1.img 3) Create partition table (with parted): mklabel msdos 4) Create partition (with parted): mkpart primary fat32 1MB 100% 5) Print:
(parted) print                                                            
    Modell:  (file)
    Festplatte  /DISK1.img:  1258MB
    Sektorgröße (logisch/physisch): 512B/512B
    Partitionstabelle: msdos
    Disk-Flags: 
    
    Nummer  Anfang  Ende    Größe   Typ      Dateisystem  Flags
     1      1049kB  1258MB  1257MB  primary  fat32        lba
Now when I quit and reopen parted the filesystem is not recognized anymore:
(parted) print                                                            
Modell:  (file)
Festplatte  /DISK1.img:  1258MB
Sektorgröße (logisch/physisch): 512B/512B
Partitionstabelle: msdos
Disk-Flags: 

Nummer  Anfang  Ende    Größe   Typ      Dateisystem  Flags
 1      1049kB  1258MB  1257MB  primary               lba
How do I create an image from scratch? ### EDIT 2024-03-02 Using the comment from @Stephen Kitt it worked: 1) dd if=/dev/zero of=DISK1.img bs=1M count=1200 2) parted DISK1.img 3) Create partition table (with parted): mklabel msdos 4) Create partition (with parted): mkpart primary fat32 1MB 100% 5) Quit parted 6) mkfs.vfat -v --offset 2048 DISK1.img To mount the partition: 1) Find startsector: fdisk -lu DISK1.img (same as above) 2) Get offset in bytes: 512bytes * 2048sectors = 1048576 3) lopsetup partition: sudo losetup -o 1048576 /dev/loop0 DISK1.img 4) Mount: sudo mount /dev/loop0 DISK_MOUNT 5) Copy data to mounted partition (Root required) 6) unmount sudo umount /dev/loop0 7) Detach losetup: sudo losetup -d /dev/loop0 Now the new data is in the disk image
Murmi (13 rep)
Feb 28, 2024, 06:15 PM • Last activity: Mar 2, 2024, 09:10 AM
0 votes
1 answers
238 views
Ubuntu resize partition in in backward direction
I am using Ubuntu 22.04 LTS in a windows dual boot setup. This is the state of the partitions at the moment. (Windows Screenshot) [![Partition Screenshot][1]][1] On my Ubuntu, I have the following ```bash df -H Filesystem Size Used Avail Use% Mounted on tmpfs 3.4G 3.0M 3.4G 1% /run efivarfs 263k 138...
I am using Ubuntu 22.04 LTS in a windows dual boot setup. This is the state of the partitions at the moment. (Windows Screenshot) Partition Screenshot On my Ubuntu, I have the following
df -H                                                                     
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           3.4G  3.0M  3.4G   1% /run
efivarfs        263k  138k  120k  54% /sys/firmware/efi/efivars
/dev/nvme0n1p6   51G   42G  6.2G  88% /
tmpfs            17G  1.1M   17G   1% /dev/shm
tmpfs           5.3M  4.1k  5.3M   1% /run/lock
/dev/nvme0n1p7  160G   57G   96G  38% /home
/dev/nvme0n1p1  101M   35M   67M  34% /boot/efi
tmpfs           3.4G  177k  3.4G   1% /run/user/1000
Partition 6 (/) and partition 8 (/home) are the ones I am using for Ubuntu and want to expand them to un-allocated spaces. **How can I safely resize my partition 6 to take up available space on the left?**
inquilabee (103 rep)
Feb 12, 2024, 01:52 PM • Last activity: Feb 12, 2024, 02:39 PM
0 votes
1 answers
1127 views
Reboot into `initramfs` after altering partition table
Problem Overview ---------------- I recently upgraded my remote server contract with IONOS, increasing my hard drive space from 8GB to 80GB. I have an Ubuntu OS running bash. I then went about extending my working partition, following a tutorial here: https://www.ryadel.com/en/resize-extend-disk-par...
Problem Overview ---------------- I recently upgraded my remote server contract with IONOS, increasing my hard drive space from 8GB to 80GB. I have an Ubuntu OS running bash. I then went about extending my working partition, following a tutorial here: https://www.ryadel.com/en/resize-extend-disk-partition-unallocated-disk-space-linux-centos-rhel-ubuntu-debian/ All was OK, I wrote a new partition map, then rebooted my system. I waited a minute or two and then attempted to ssh into my server as usual. Problem. My ssh connection hangs, until eventually exiting with a time out. Solution Attempts ----------------- At first, I reasoned the process of rebooting after a partition map change may take some time, and this was the cause of the timeout. After several more ssh attempts, this did not seem likely. I used a 'KVM Console' provided in my IONOS console - here, the shell is in a state of (initramfs). In attempting to diagnose the issue, I have tried the following: 1) Running: fsck /dev/sda1 Result: /dev/sda1: clean, 312/124672 files, 26890/124672 blocks 2) Running: fsck /dev/sda1 Result: fsck: error 2 (No such file or directory) while executing fsck.ext2 for /dev/sda2 3) Running: blkid Result: /dev/sda1: UUID="longString" TYPE="ext4" PARTUUID="520f1760-01" /dev/sda2: PARTUUID="520f1760-02" 4) Running all of the following commands returns sh: command name: not found. These are: - vgdisplay -v vg00 - parted -l /dev/sda - free -m - cfdisk - lvdisplay -v - fdisk /dev/sda - pvresize /dev/sda2 5) The output of cat proc/partitions is:
major minor #blocks name
8 0 83886080 sda
8 1 498688 sda1
8 2 83386368 sda2
11 0 1048575 sr0
From the above, I am confused why (2) returns no such file or directory - the entry sda2 is listed under the directory dev. 6) The output of cat /proc/cmdline is: BOOT_IMAGE=/vmlinuz-5.4.0-132-generic root=/dev/mapper/vg00-lv01 ro apparmor=0 7) After entering lvm and then vgscan -ccc, the output is:
....
Start of output not visible in terminal window due to no scrolling
....
filter caching bad /dev/loop5
Opened /dev/loop6 RO O_DIRECT
/dev/loop6: size is 0 sectors
Closed /dev/loop6
/dev/loop6: Skipping: Too small to hold a PV
filter caching bad /dev/loop6
Opended /dev/loop7 RO O_DIRECT
/dev/loop7: size is 0 sectors
Closed /dev/loop7
/dev/loop7: Skipping: Too small to hold a PV
filter caching bad /dev/loop7
Will scan 3 devices skip 0
Checking fd limit for num_devs 3 want 35 soft 1024 hard 4096
Scanning 3 devices for VG info
Scanning submitted 3 reads
Processing data from device /dev/sda 8:0 fd 4 block 0x55b511a17cd0
Scan filtering /dev/sda
/dev/sda: using cached size 167772160 sectors
/dev/sda: Skipping: Partition table signature found
filter caching bad /dev/sda
/dev/sda: Not processing filtered
Processing data from device /dev/sda1 8:1 fd 5 block 0x55b511a17d10
Scan filtering /dev/sda1
/dev/sda1: using cached size 997376 sectors
/dev/sda1: Device is a partition, using primary device sda for mpath component detection
/dev/sda1: using cached size 997376 sectors
filter caching good /dev/sda1
/dev/sda1: No lvm label detected
Processing data from device /dev/sda2 8:2 fd 6 block 0x55b511a17d50
Scan filtering /dev/sda2
/dev/sda2: using cached size 166772736 sectors
/dev/sda2: Device is a partition, using primary device sda for mpath component detection
/dev/sda2: using cached size 166772736 sectors
filter caching good /dev/sda2
Label checksum incorrect on /dev/sda2 - ignoring
/dev/sda2: No lvm label detected
Scanned devices: read errors 0 process errors 0 failed 0
Found VG info for 0 VGs
Obtaining the complete list of VGs to process
No volume groups found
Unlocking /run/lock/lvm/P_global
_undo_flock /run/lock/lvm/P_global
Dropping VG info
lvmcache has no info for vgname "#orphans_lvm2" with VGID #orphans_lvm2.
lvmcache has no info for vgname "#orphans_lvm2".
lvmcache: Initialised VG #orphans_lvm2.
Completed: vgscan -vvv
8) The directory /etc/lvm/backup exists and contains: vg00 The directory /etc/lvm/archive exists and contains: vg00_00000-1647277590.vg vg00_00001-1228658393.vg (3) and (5) give me hope - the location seems to be recognised, what would this suggest ? Specific Steps Before Reboot ---------------------------- In summary, the steps I took before rebooting my system were: 1) ran fdisk /dev/sda and noted the start and end points of the file systems by entering p. 2) Deleted the file system map by entering d and then selecting sda2 with 2 3) Created a new partition map by entering n. Setting the partition type to primary. 4) I then entered the start and end locations for the new partition, as noted in step (1). 5) I changed the partition type, by entering t, and selecting the 2nd partition by entering 2. 6) I specified the partition type to be 'Linux LVM' by entering the HEX code 8e. 7) Before writing to the disk, I ensured start and end points were correctly listed by entering p. The start point matched that of the original partition. The end point matched that of the disk end point. 8) I wrote the partition map to disk by entering w. 9) I reboot the system with reboot. The result of running lvm p prior to partition map changes was: lvm p output At this point I am not sure how to proceed - I have encountered a file system issue before and was troubled at the prospect of loosing all my files. Ultimately, in that case, the files were still present. From that experience I am restraining my assumption all is lost. Does anyone have any suggestions, or tips to offer in terms of debugging this situation ? Please feel free to ask if you would like extra information regarding my setup. Update ------ I have been able to boot into a knoppix CD on my remote server. Here, I have run fdisk -l which outputs:
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/cloop0: 1.83 GiB, 1960312832 bytes, 3828736 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/cloop1: 9.63 GiB, 10335027200 bytes, 20185600 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/zram0: 1.45 GiB, 1560817664 bytes, 381059 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/sda: 80 GiB, 85899345920 bytes, 167772160 sectors
Disk model: Virtual disk    
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: 0x520f1760

Device     Boot  Start       End   Sectors  Size Id Type
/dev/sda1  *      2048    999423    997376  487M 83 Linux
/dev/sda2       999424 167772159 166772736 79.5G 8e Linux LVM
I feel the final output lines, displaying the partition map for sda1 and sda2, are of interest. I believe the type of sda2 is correct as 8e (a Linux LVM), and the Start value correctly falls after the End of sda1. Update II --------- Before attempting the below steps, I created a snapshot for backing up the system to its current state. I have now returned to this snapshot. Attempting to restore from the /etc/lvm/backup/vg00 file (initramfs), first I ran pvcreate --restorefile /etc/lvm/backup/vg00 --uuid R5VWXg-jamB-5dWM-PpwY-7a49-LRz7-Vrvdl2 /dev/sda2. This returned:
WARNING: Couldn't find device with uuid `R5VWXg-jamB-5dWM-PpwY-7a49-LRz7-Vrvdl2. 
Failed to clear hint file.
Physical volume "/dev/sda2" successfully created.
Then, I ran vgcfgrestore --file /etc/lvm/backup/vg00 which returned:
No command with matching syntax recognised.
Nearest similar syntax command has syntax:
vgfcgrestore -f:--file String VG
Restore VG metadata from specified file.
There seems to be an issue here.
user10709800 (73 rep)
Feb 1, 2024, 06:34 PM • Last activity: Feb 3, 2024, 09:48 PM
2 votes
3 answers
26584 views
Cannot create New folder and Paste files on a drive - Ubuntu
[![enter image description here][1]][1] My Files drive is not able to modify [![enter image description here][2]][2] [1]: https://i.sstatic.net/lKS58.png [2]: https://i.sstatic.net/PNIL0.png
enter image description here My Files drive is not able to modify enter image description here
TheV (21 rep)
Dec 2, 2019, 04:18 AM • Last activity: Jan 22, 2024, 07:31 AM
0 votes
1 answers
2316 views
Partition mounting/resizing failed to read last sector?
After a failed resizing operation, mount operation is failing with: Failed to read last sector (718198764): Invalid argument The partition is not accessible with Gparted and other GUI tools. How can we fix such issue?
After a failed resizing operation, mount operation is failing with: Failed to read last sector (718198764): Invalid argument The partition is not accessible with Gparted and other GUI tools. How can we fix such issue?
intika (15066 rep)
Jul 6, 2020, 01:37 AM • Last activity: Jan 3, 2024, 03:31 AM
0 votes
1 answers
134 views
Handle Partition Changes Embedded System
I have to update some outdated embedded systems. But the RAUC Update contains four partitions, while the old systems have only three partitions. The additional Partition is at the start of the disk and I cannot flash the devices with an external Adapter. What I have, is SSH access to the existing Li...
I have to update some outdated embedded systems. But the RAUC Update contains four partitions, while the old systems have only three partitions. The additional Partition is at the start of the disk and I cannot flash the devices with an external Adapter. What I have, is SSH access to the existing Linux on the device. Could I change the partition table somehow from within the running system and thereby move the system partition? Or could I somehow dd the whole disk with a new image? I just cannot get my head around this problem and I am not sure, if I am missing a good solution here.
Cellcon (135 rep)
Nov 9, 2023, 09:38 AM • Last activity: Nov 15, 2023, 01:49 PM
1 votes
2 answers
481 views
How to make Linux read partition table in a partition?
I have a (GPT-partitioned) disk, for example `/dev/sda`. `/dev/sda8` is a partition on that disk. I used the `cfdisk` utility to create a GPT table with few partitions in `/dev/sda8`. I expected these partitions to become available via something like `/dev/sda8p1`. But Linux did not automatically re...
I have a (GPT-partitioned) disk, for example /dev/sda. /dev/sda8 is a partition on that disk. I used the cfdisk utility to create a GPT table with few partitions in /dev/sda8. I expected these partitions to become available via something like /dev/sda8p1. But Linux did not automatically recognize them. How do I make Linux recognize partitions in a partition, and automatize that if possible?
melonfsck - she her (150 rep)
Nov 1, 2023, 07:05 AM • Last activity: Nov 1, 2023, 10:42 AM
2 votes
1 answers
3034 views
Does `wipefs` require --force to erase the partition table on a disk?
The `wipefs` man page says that: > `-f, --force` > Force erasure, even if the filesystem is mounted. **This is required in order to erase a partition-table signature on a block device**. So this means that every time I want to overwrite a partition table signature on a block device, I need to add `-...
The wipefs man page says that: > -f, --force > Force erasure, even if the filesystem is mounted. **This is required in order to erase a partition-table signature on a block device**. So this means that every time I want to overwrite a partition table signature on a block device, I need to add -f. Later in the man page, one of the usage examples given is: > wipefs --all --backup /dev/sdb > **Erases all signatures** from the device /dev/sdb and creates a signature backup file ~/wipefs-sdb-.bak for each signature. So this example overwrites all signatures from a block device, obviously including the partition table signature. According to what was stated earlier, this will not work, because it does not include -f. Now I don't know whether to use -f or not. When trying to erase **all** signatures from a disk, including the partition table, is the --force option required?
EmmaV (4359 rep)
Aug 21, 2023, 08:01 AM • Last activity: Oct 1, 2023, 12:32 PM
Showing page 1 of 20 total questions