LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Partition Table Does Not Exist on Device (https://www.linuxquestions.org/questions/linux-newbie-8/partition-table-does-not-exist-on-device-4175692379/)

G-MAN2021 03-20-2021 04:58 PM

Partition Table Does Not Exist on Device
 
Hello,

I'm using the Control4 system in my home. The controller (EA-5 v1) for the system is running a linux flavored OS. The boot files is on a eMMC chip.

Based on the screenshot below, it looks like partition 1 is invalid. How can I recreate or repair partition 1 without losing data.

I can provide more information if you need it.


****
~ # fdisk -l
fdisk -l
Disk /dev/mtdblock0: 16 MB, 16777216 bytes, 32768 sectors
2 cylinders, 255 heads, 63 sectors/track
Units: cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/mtdblock0 doesn't contain a valid partition table
Disk /dev/mmcblk0: 7456 MB, 7818182656 bytes, 15269888 sectors
238592 cylinders, 4 heads, 16 sectors/track
Units: cylinders of 64 * 512 = 32768 bytes

Device Boot StartCHS EndCHS StartLBA EndLBA Sectors Size Id Type
/dev/mmcblk0p1 1023,3,16 1023,3,16 65536 12648448 12582913 6144M 83 Linux
/dev/mmcblk0p2 1023,3,16 1023,3,16 12648449 14745601 2097153 1024M 83 Linux
/dev/mmcblk0p3 1023,3,16 1023,3,16 14745602 14811138 65537 32.0M 83 Linux
Disk /dev/mmcblk0boot1: 2 MB, 2097152 bytes, 4096 sectors
64 cylinders, 4 heads, 16 sectors/track
Units: cylinders of 64 * 512 = 32768 bytes

Disk /dev/mmcblk0boot1 doesn't contain a valid partition table
Disk /dev/mmcblk0boot0: 2 MB, 2097152 bytes, 4096 sectors
64 cylinders, 4 heads, 16 sectors/track
Units: cylinders of 64 * 512 = 32768 bytes

Disk /dev/mmcblk0boot0 doesn't contain a valid partition table

G-MAN2021 03-20-2021 05:02 PM

More information...

~ # df
df
Filesystem 1K-blocks Used Available Use% Mounted on
none 797060 0 797060 0% /dev

G-MAN2021 03-20-2021 05:04 PM

More information...

~ # blkid
blkid
/dev/mmcblk0p3: LABEL="logs" UUID="d51c4f67-c604-48ec-a907-6e43b6e90c66" TYPE="ext4"
/dev/mmcblk0p2: LABEL="recfs" UUID="a61f4144-f1b8-4592-8fae-28b98ef25d3e" TYPE="ext4"
/dev/mmcblk0p1: LABEL="rootfs" UUID="3e4763da-1389-4e93-9d41-7e6d3f4c88f9" TYPE="ext4"
~ #

G-MAN2021 03-20-2021 05:07 PM

This is the errors I'm getting when booting up the Control4 EA-5 Controller...


[*] Creating base directories for init fs ...
Set System Time From RTC
[ 6.455383] rtc-ds1307 0-0068: rtc core: registered ds1339 as rtc0
[ 6.462299] i2c i2c-0: new_device: Instantiated device ds1339 at 0x68
Date is now Sat Mar 20 22:46:01 UTC 2021[*] Executing Normal Boot Process![*] Checking ext4 filesystem /dev/mmcblk0p1...
rootfs: recovering journal
rootfs: clean, 19702/393216 files, 385858/1572864 blocks[*] Checking ext4 filesystem /dev/mmcblk0p2...
recfs: clean, 14/65536 files, 114875/262144 blocks[*] Checking ext4 filesystem /dev/mmcblk0p3...
logs: clean, 29/8192 files, 10076/32768 blocks[*] Mounting /rootfs read-only...[*] Executing Mount Command[ 6.614091] EXT4-fs (mmcblk0p1): barriers disabled
: "mount -t ext4 -o rw,discard,noatime,data=ordered,nobarrier /d[ 6.623313] EXT4-fs (mmcblk0p1): mounting with "discard" option, but the device does not support discard
ev/mmcblk0p1 /rootfs"
[ 6.636817] EXT4-fs (mmcblk0p1): mounted filesystem with ordered data mode. Opts: discard,data=ordered,nobarrier[*] Switching / to /rootfs
mount: mounting /sys on /rootfs/sys failed: No such file or directory
mount: mounting /proc on /rootfs/proc failed: No such file or directory
mount: mounting /dev on /rootfs/dev failed: No such file or directory[*] Executing exec switch_root /rootfs /sbin/init
switch_root: can't execute '/sbin/init': No such file or directory
[ 6.685056] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100
[ 6.685056]
[ 6.694166] CPU: 3 PID: 1 Comm: switch_root Not tainted 3.12.74 #139-8e8c0f87-ninjago.1
[ 6.702135] 00000000 c15f47c9 c17df060 d8df96f4 c15f14c3 c170de54 c1bd9700 c17df060
[ 6.709839] d8df96f4 d9450000 d9450000 c1039a28 c170e0bc 00000100 00000043 d9079710
[ 6.717546] 00000002 c10f63e5 00000001 00000001 00000000 d96939c8 d94501d8 d9459f80
[ 6.725253] Call Trace:
[ 6.727691] [<c15f47c9>] ? dump_stack+0x44/0x57
[ 6.732292] [<c15f14c3>] ? panic+0x7d/0x16c
[ 6.736543] [<c1039a28>] ? do_exit+0x798/0x8a0
[ 6.741052] [<c10f63e5>] ? vfs_write+0x105/0x190
[ 6.745736] [<c1039b8a>] ? do_group_exit+0x2a/0x80
[ 6.750593] [<c1039bef>] ? SyS_exit_group+0xf/0x10
[ 6.755452] [<c15faafc>] ? syscall_call+0x7/0x7

Emerson 03-20-2021 05:08 PM

You can have a filesystem without wrapping it into partition table, you need partitioning only if there is more than one filesystem.

G-MAN2021 03-20-2021 05:19 PM

Quote:

Originally Posted by Emerson (Post 6232502)
You can have a filesystem without wrapping it into partition table, you need partitioning only if there is more than one filesystem.

I think the Control4 system requires those 3 partitions on the eMMC chip/drive.

I don't have an option.

Is Partition 1 corrupt? How can I repair Partition 1? Maybe the eMMC chip is bad as well.

G-MAN2021 03-20-2021 05:39 PM

More information.. Trying to run the init program on the system and it's failing..


~ # ./init
./init
mount: mounting none on /sys failed: Device or resource busy
mount: mounting none on /proc failed: Device or resource busy
mount: mounting none on /dev failed: Device or resource busy
mount: mounting none on /dev/pts failed: Device or resource busy
Type 'c4' followed by [ENTER] within the next 2 seconds to stop boot and break into initramfs.
Terminated[*] Creating base directories for init fs ...
Set System Time From RTC
[ 56.268566] rtc-ds1307 0-0068: rtc core: registered ds1339 as rtc0
[ 56.275491] i2c i2c-0: new_device: Instantiated device ds1339 at 0x68
Date is now Sat Mar 20 23:18:01 UTC 2021[*] Executing Normal Boot Process![*] Checking ext4 filesystem /dev/mmcblk0p1...
/usr/sbin/fsck.ext4: Superblock invalid, trying backup blocks...

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
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>
[*] Appears there was an error fscking the rootfs filesystem...[*] Checking ext4 filesystem /dev/mmcblk0p2...
/usr/sbin/fsck.ext4: Superblock invalid, trying backup blocks...

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
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>
[*] Appears there was an error fscking the recovery filesystem...[*] Checking ext4 filesystem /dev/mmcblk0p3...
/usr/sbin/fsck.ext4: Superblock invalid, trying backup blocks...

The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
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>
[*] Appears there was an error fscking the persistent logs filesystem...[*] Mounting /rootfs read-only...[*] Executing Mount Command: "mount -t ext4 -o rw,discard,noatime,data=ordered,nobarrier /dev/mmcblk0p1 /rootfs"
mount: mounting /dev/mmcblk0p1 on /rootfs failed: Invalid argument

/init failed: failed to mount /rootfs read-only

ERROR! Dropping to a shell


BusyBox v1.27.1 (2020-05-19 20:39:20 MDT) built-in shell (ash)
Enter 'help' for a list of built-in commands.

/bin/sh: can't access tty; job control turned off
~ #

G-MAN2021 03-20-2021 05:41 PM

Files on the system...


~ # ls
ls
bin etc proc tmp
check_input.sh init recovery_boot usr
common_initramfs lib root var
control4 mfg_prog rootfs
dev mnt sbin
dev_prog_boot normal_boot sys

Emerson 03-20-2021 06:04 PM

How many block devices is there?

Code:

/dev/mtdblock0: 16 MB, 16777216 bytes, 32768 sectors

/dev/mmcblk0: 7456 MB, 7818182656 bytes, 15269888 sectors

/dev/mmcblk0boot1: 2 MB, 2097152 bytes, 4096 sectors

/dev/mmcblk0boot0: 2 MB, 2097152 bytes, 4096 sectors

Four? At least one has partition table, /dev/mmcblk0 has three partitions. Which one has the root filesystem? It seems to have some corruption. From your messages it is not clear, you cannot work on several disks at the same time, it only confuses the issue.

colorpurple21859 03-20-2021 06:08 PM

is there a /etc/fstab and if so post the contents.

syg00 03-20-2021 06:28 PM

eMMC (for u-boot) are an entirely different animal to what we are used to in the real world. I did look into it a while back, but couldn't get it straight since I don't have such a system to play on.
Normally recreating a partition table is trivial, but I'm not prepared to suggest anything here.

Emerson 03-20-2021 06:33 PM

So far I see partition table only in one device, and it is not damaged. The title of this thread is misleading at least.

G-MAN2021 03-20-2021 06:52 PM

Quote:

Originally Posted by Emerson (Post 6232521)
So far I see partition table only in one device, and it is not damaged. The title of this thread is misleading at least.

I'm sorry. I'm a Linux newbie.. Just trying to figure out whether I have a corrupt EMMC drive.

Please let me know what other logs to post to help in troubleshooting.

Emerson 03-20-2021 07:58 PM

No need to be sorry. I have no clue what we are facing here myself, no experience with such a device. What I would do is I'd try and mount these filesystems one by one to understand their purpose, looking at their contents. It always helps if you understand how the device works.
Is there a known reason for this failure, like blown power supply or ... ? Or it just started malfunctioning out of blue? In case some files are damaged and/or even lost, do you have a source where to get this OS from when you need to replace it?

G-MAN2021 03-20-2021 09:14 PM

Quote:

Originally Posted by colorpurple21859 (Post 6232519)
is there a /etc/fstab and if so post the contents.

/proc /proc proc defaults
/sys /sys sysfs defaults
devtmpfs /dev devtmpfs defaults


~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
~
- fstab 1/5 20%


All times are GMT -5. The time now is 02:25 PM.