lunes, 17 de junio de 2013

Montar particiones minix

A la vista de esto (http://minix1.woodhull.com/faq/mxfromlx.html).

#!/bin/sh
# mxmount
# asw 21.12.97

# >Hi,
# >
# > I tried to mount a Minix partition(/dev/hda2 in Linux,
# >/dev/hd2 in Minix) as a Minix file system in Linux with command,
# >
# >mount -t minix /dev/hda2 /mnt
# >
# >but failed. My Minix is installed from Tanenbaum's 1997 book CD.
# >
# > Then I investigated how Minix file system is installed. I
# >found that the Minix primary partition(/dev/hd2) consists of 2
# >subpartitions(/dev/hd2a and /dev/hd2c) which are separately mounted as
# >/ and /usr. I guess that Linux mount cannot resolve such partition
# >organization.
# >
#
#
# Well, yes and no. There was a discussion on this topic a while ago in this
# newsgroup. You can set things up so linux can "see" minix logical partitions
# by treating the entire minix partition as a file and mounting it on the
# loop device. A loop device is a driver that allows the linux kernel to treat
# a file as a filessytem -- quite handy in certain situations. Support for
# the loop device must be selected during make config. It has been available
# since 2.0.0.
#
# The following is a shell script I use to make my minix filesystem with
# its two logical subpartitions available from minix. (I also have two
# other minix partitions which are not sub-partitioned.) It gives the main
# idea-- you will need to adapt it for your own situation of course:
#
# (Terry's original script begins here)
#
# Mounts minix directorys so that they can be accessed from linux
# Based on tips from Alan M. Alpert as posted on comp.os.minix
# (More on loopback under linux)


# setup loop back devices. I guess the 512 offset in the first one
# gets us past the boot sector. This is for the first (minix) logical
# partition in /dev/hda3 ( = minix's /dev/hd3a ). The second one is
# for the second logical partition in /dev/hda3 which begins at 512 +
# 1440 x 1024 = 1475072 -- since there are 1440 blocks in the first
# logical partition.


# Terry's example:
# /sbin/losetup /dev/loop0 /dev/hda3 -o 512
# /sbin/losetup /dev/loop1 /dev/hda3 -o 1475072


# asw system: minix root is hd4a at offset 512
# usr is hd4c at 512 + 2x1024x1440=2949632. The "2x" is needed
# because there are two 1440 block subpartitions before the usr partition
/sbin/losetup /dev/loop0 /dev/hda4 -o 512
/sbin/losetup /dev/loop1 /dev/hda4 -o 2949632


# mount the minix root fs on /minix
/bin/mount -t minix /dev/loop0 /minix


# mount the minix usr fs on /minix/usr
/bin/mount -t minix /dev/loop1 /minix/usr

he corrido esto

root@debian:/home/jorge# fdisk /dev/sda3

Command (m for help): p

Disk /dev/sda3: 4235 MB, 4235309056 bytes
255 heads, 63 sectors/track, 514 cylinders, total 8272088 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 identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sda3p1 * 250836276 250869043 16384 81 Minix / old Linux
/dev/sda3p2 250869044 254965043 2048000 81 Minix / old Linux
/dev/sda3p3 254965044 259108362 2071659+ 81 Minix / old Linux

Command (m for help):

he hecho "la cuenta la vieja"

>>> 16384*1024+512
16777728
>>> (16384+2048000)*1024+512
2113929728
>>> exit(0)

y luego he ejecutado esto otro

root@debian:/home/jorge# /sbin/losetup /dev/loop0 /dev/sda3 -o 512
root@debian:/home/jorge# /sbin/losetup /dev/loop1 /dev/sda3 -o 16777728
root@debian:/home/jorge# /sbin/losetup /dev/loop2 /dev/sda3 -o 2113929728

y esto

root@debian:/home/jorge# mount -t minix /dev/loop0 /mnt/MINIX/
root@debian:/home/jorge# mount -t minix /dev/loop1 /mnt/MINIX/home
root@debian:/home/jorge# mount -t minix /dev/loop2 /mnt/MINIX/usr

No me ha llevado nada más que toda la tarde. XD