LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Live-boot (debian) secondary mount parameter for kernel? (https://www.linuxquestions.org/questions/linux-newbie-8/live-boot-debian-secondary-mount-parameter-for-kernel-4175641331/)

OSBuildX 10-28-2018 05:14 PM

Live-boot (debian) secondary mount parameter for kernel?
 
Figured lets start with something "easy".

hardware:
- Laptops/Desktops, new and old machines.
- USB HDD (with UAS, USB-to-SCSI) or USB stick.
- USB 2.0 (using USB 2.0 hub since never sure about compatibility over USB 3.0/3.1)

Partitioning:
1#: Primary (FAT16, active, bootable, grub4dos)
#: Extended Partition
5#: Logical (FAT32)
6#: Logical (NTFS)
7#: Logical (NTFS)


bootloader / OS: G4D (0.4.6a), Debian Live Stretch 9.5.0

Example (boot from ISO):
Code:

kernel (hd0,5)/LIVE/vmlinux boot=live components findiso=/LIVE/live.iso nopersistence noeject
initrd (hd0,5)/LIVE/initrd.img

(can also use fromiso=/dev/sda6/LIVE/live.iso which makes no difference except being faster maybe)

Example (boot from logical partition directly):
Code:

kernel (hd0,5)/LIVE/vmlinux boot=live components bootfrom=/dev/sda6 nopersistence noeject
initrd (hd0,5)/LIVE/initrd.img


Now there's 2 problems here:
1. Either initramfs fails or debian doesn't know what FAT16. (Mounting of /dev/sda1 fails as it some magical way attemps to mount it as ext4, if I view /etc/fstab at live system. Remounting is possible using vfat type.)
2. Mounting 3rd logical (or primary) NTFS partition at /dev/sda7 fails. ntfs-3g fails to mount it so does "mount -t ntfs ..."

Question:

Is there anyway to pass mount parameters to kernel at command-line ?

- I know fromiso/findiso mounts the partition with ISO/SquashFS at '/lib/live/media/fromiso' Read-Writable as root. So, can I also somehow pass parameter to kernel/initramfs to mount 3rd logical partition the same way?
Example: somepath=/dev/sda7 (which would also appear at /lib/live/media/somepath
- As for boot partition identified as ext4, well would be also nice to pass parameters, so, it would be identified as vfat (or FAT16).

mrmazda 10-28-2018 05:34 PM

It looks to me like you're being thrown off by the HD becoming sdb when you boot from USB. What is the actual output from
Code:

fdisk -l
(placed here within code tags) booted from your Linux USB?

OSBuildX 10-28-2018 05:55 PM

Quote:

Originally Posted by mrmazda (Post 5920248)
It looks to me like you're being thrown off by the HD becoming sdb when you boot from USB.

Well, actually I removed all HDs from the test machine and that's why the USB-HDD with SCSI controller is detected as /dev/sdaX



fdisk -l (booted from ISO as desc. above):

Code:

user@debian:~$ sudo fdisk -l
Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 byte
Disklabel type: dos
Disk identifier: 0x8bf95b60

Device    Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048  1030143  1028096  502M  6 FAT16
/dev/sda2        1030176 976771071 975740896 465.3G  f W95 Ext'd (LBA)
/dev/sda5        1030207  66584575  65554369  31.3G  b W95 FAT32
/dev/sda6        66584640 335019509 268434870  128G  7 HPFS/NTFS/exFAT
/dev/sda7      335022080 976771071 641748992  306G  7 HPFS/NTFS/exFAT


Disk /dev/loop0: 2.6 GiB, 2800257024 bytes, 5469252 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/loop1: 2.6 GiB, 2762993664 bytes, 5396472 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


blkid:
Code:

user@debian:~$ sudo blkid
/dev/sda1: SEC_TYPE="msdos" LABEL="BT" UUID="F123-2F00" TYPE="vfat" PARTUUID="8bf95b60-01"
/dev/sda5: LABEL="TOOLS" UUID="3E9F-9C00" TYPE="vfat" PARTUUID="8bf95b60-05"
/dev/sda6: LABEL="LINUX" UUID="01D46965E7C640D0" TYPE="ntfs" PARTUUID="8bf95b60-06"
/dev/sda7: LABEL="STORAGE" UUID="01D4680F765A1400" TYPE="ntfs" PARTUUID="8bf95b60-07"
/dev/loop0: UUID="2018-10-28-15-22-16-" LABEL="DEBIAN" TYPE="iso9660"
/dev/loop1: TYPE="squashfs"


/etc/fstab looks like this (FAT16 error):
Code:

proc /proc proc defaults 0 0
/dev/sda1 / ext4 errors=remount-ro 0 1
overlay / overlay rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0

-Above /dev/sda1 is incorrectly detected as EXT4.

Mounting /dev/sda7 error:
Code:

user@debian:~$ mkdir $HOME/storage
user@debian:~$ sudo mount -t "ntfs" "/dev/sda7" "/$HOME/storage"
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
ntfs_mst_post_read_fixup_warn: magic: 0x00000000  size: 1024  usa_ofs: 0  usa_count: 65535: Invalid argument
$MFTMirr does not match $MFT (record 16).
Failed to mount '/dev/sda7': Input/output error
NTFS is either inconsistent, or there is a hardware fault, or it's a
SoftRAID/FakeRAID hardware. In the first case run chkdsk /f on Windows
then reboot into Windows twice. The usage of the /f parameter is very
important! If the device is a SoftRAID/FakeRAID then first activate
it and mount a different device under the /dev/mapper/ directory, (e.g.
/dev/mapper/nvidia_eahaabcc1). Please see the 'dmraid' documentation
for more details.

-Above mount has been tested with 3 different HDs (1 cloned, 2 completely reformatted) and 1 USB stick I got here for testing. So, I kinda doubt it would be hardware error which I assumed at first.

OSBuildX 10-28-2018 09:04 PM

There seems to be one solution I just tested that will work, repartitioning:

/dev/sda
1#: Primary (FAT16, active, bootable, grub4dos)
#: Extended Partition
5#: Logical (FAT32)
6#: Logical (NTFS)
7#: Logical (NTFS)
8#: Logical (EXT4/NTFS/FAT32) <- Minimal /LIVE (ISO or extracted vmlinuz/initrd/squashfs).

Not a perfect, but at least I can mount/see all partitions now. Not counting:
- Still have to remount /dev/sda1 at system. *some bug in latest initramfs/kernel*
- Original problem of this post is just moved to last partition. Problem persist still of having partition containing files for live-boot at RO mode and readable only by root.


All times are GMT -5. The time now is 08:52 PM.