LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   mount iso in single user mode (https://www.linuxquestions.org/questions/slackware-14/mount-iso-in-single-user-mode-4175678642/)

zdolar 07-13-2020 07:28 AM

mount iso in single user mode
 
Hi!

Virtualbox Slackware64-current
I somehow lost a few files in a folder /etc/pam.d.
So I can not boot root (or any other user).
I can boot into a single user mode and
Code:

/sbin/mount /dev/sda1 / -o remount,rw
works, so I can access the system read/write.
I wish to copy missing files from another working VBOX Slackware (same version).
I've created an ISO image from a working /etc/pam.d with all files included.

When I want to mount that ISO, I got:
Code:

mount: /mnt/dvd: mount failed: Operation not permitted.
If I try to force -ro mount, then I got:
Code:

mount: /mnt/dvd: can't find in /etc/fstab.
How to mount ISO to copy files from it?
Is there any other option? - There's no network, no modules, so I see only ISO mount possible.

rkelsen 07-13-2020 07:39 AM

mount iso in single user mode
 
what command are you using to mount the iso file?

it looks like you might be missing something.

colorpurple21859 07-13-2020 08:07 AM

mount -t iso9660 -o loop /<path to iso> /<path to mount point>

zdolar 07-13-2020 08:11 AM

Quote:

Originally Posted by rkelsen (Post 6144875)
what command are you using to mount the iso file?

it looks like you might be missing something.

/sbin/mount /dev/sr0 /mnt/tmp

And I found out, there's no /dev/sr*

In a mean time, I simply added another working instance as a secondary drive to VirtualBox. At boot I had /dev/sda1 (root) and /dev/sdb1 - another working slackware64-current Virtualbox drive. I copied files as mentioned in a previous post.
And :) :) at next boot, the system booted normally.

So my main problem is solved, but I'm still interested, how to mount ISO image from a single user mode.

michaelk 07-13-2020 08:25 AM

Did you copy the ISO file from the working guest to the host?
How is your guests optical drive configured i.e as passthrough or virtual device?

Configured as a virtual device did you select the ISO file using the devices -> optical drive menu? That "inserts" the ISO file into the virtual disk drive. Once the ISO is "inserted" you can then mount it via

mount -t iso9660 /dev/dvd /mnt (or as desired...)

zdolar 07-13-2020 08:54 AM

Quote:

Originally Posted by michaelk (Post 6144888)
Did you copy the ISO file from the working guest to the host?
Configured as a virtual device did you select the ISO file using the devices -> optical drive menu? That "inserts" the ISO file into the virtual disk drive. Once the ISO is "inserted" you can then mount it via

mount -t iso9660 /dev/dvd /mnt (or as desired...)

Yes Configured as a virtual device did you select the ISO file using the devices -> optical drive menu.
And the problem is, no new entry is created in /dev/ There are only sda and sda1 disks, no other. And strange "Remove disk from virtual drive" is clickable, reflecting image is inserted. When I click on it, tick is removed in front of image and "remove disk .." become grey.

Looks like Slackware in single user mode do not insert image/CD and /dev/XYZ is not created.

pan64 07-13-2020 09:19 AM

Just a guess: probably you need to boot first and insert the disk when the system is already running.

zdolar 07-14-2020 07:16 AM

1 Attachment(s)
Quote:

Originally Posted by pan64 (Post 6144905)
Just a guess: probably you need to boot first and insert the disk when the system is already running.

Thanks for hint, but this did not helped.
Whatever I do with ISO (insert/remove) prior or after booting, the /dev folder is always the same, no devices created. I do not have a device to mount.
You can see attached picture - booted single user Slackware storage in a VirtualBox Manager. SATA Port 1 VboxGuestAdditions.iso attached but no device created.
dmesg - last message regarding / mounted as rw, ISO insertion not traced.
/var/log/ - not a single file change after ISO insertion.

Thinking of my kernal compilation - minimalistic to boot without (for me stupid) initrd all other compiled as modules including loop. I exclude hardware I do not have, to speed up kernel & modules compile and to lower kernel/modules footprint on the disk. (over 20 years practice)
This might be the key.

If I boot normally (3 - multiuser) and logon as root, then device is created and can be mounted.

For those who prefer initrd:
I always have problems at fresh Slackware install. Booting do not work, as some devices are compiled as modules (USB, years ago EXT4..). So after install I have to boot from install media, and guess which modules to include into initrd. And this "guess" = some iterations, time consuming, finger breaking..

pan64 07-14-2020 07:40 AM

but you can try to mount that vdi in another working VM or you can try to mount a regular directory from outside (as shared folder).

zdolar 07-17-2020 04:55 AM

Quote:

Originally Posted by pan64 (Post 6145261)
but you can try to mount that vdi in another working VM or you can try to mount a regular directory from outside (as shared folder).

Yes, that was a solution - my post here 13th Jul 2020 15:11

I'll close as solved.

pan64 07-17-2020 05:18 AM

Quote:

Originally Posted by zdolar (Post 6146392)
Yes, that was a solution - my post here 13th Jul 2020 15:11

I'll close as solved.

you are welcome.
If you really want to say thanks just click on yes.


All times are GMT -5. The time now is 03:46 PM.