WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: thoughts while running under user mode linux  (Read 2447 times)

Offline jim

  • Newbie
  • *
  • Posts: 15
thoughts while running under user mode linux
« on: January 13, 2010, 10:46:30 AM »
Hi,
I have been playing with Tiny Core since about V1.2, and most recently under User Mode Linux
I am writing because I got bit by the new rebuildfstab in 2.7

User Mode Linux uses as its default block device major 98 and I don't usually partition them.
Actually I don't partition a bunch of my physical (IDE/SATA/SD/CF) drives also.

It worked under at least 2.6 I would get /dev/ubda and  /mnt/ubda it would find my tce directory
"Restoring backup files from /mnt/ubda/ mounted over device /dev/ubda Done."

The new test using fdisk fails though blkid sees it just fine...
~ # fdisk -l
Disk /dev/ubda: 1073 MB, 1073742848 bytes
128 heads, 32 sectors/track, 512 cylinders
Units = cylinders of 4096 * 512 = 2097152 bytes

Disk /dev/ubda doesn't contain a valid partition table
~ # blkid
/dev/ubda: UUID="10dcf796-4b5d-4065-b163-f64d8d2f1d99" TYPE="ext2"

Currently I just change the block major number: 2 & 179 work without partitions 3,8,11,22,33,34 don't

Note that it cannot find it even with tce=LABEL=TinyCore-TCE though blkid finds it
root@box:~# blkid
/dev/ubda: LABEL="TinyCore-TCE" UUID="10dcf796-4b5d-4065-b163-f64d8d2f1d99" SEC_TYPE="ext2" TYPE="ext3"
During testing I updated to ext3 and added the LABEL "TinyCore-TCE"

Does anyone know what the problem was that was fixed by the change to rebuildfstab to use fdisk?

It seems that rebuildfstab is currently setup to avoid trying unpartitioned devices and to allow for cdroms
specified in /etc/sysconfig/cdroms and would tweak the options in fstab based on the filesystem type
yet when I was testing I was quite happy with just a generic "auto"

While playing about I tried just running a read loop from blkid's results: in bash for example
while true
do read a b
DEV=`echo $a | cut -d: -f1` # strip off the ":" at the end of the device name
eval $b # stick the values into the environment of this shell
if [ -z $DEV ] ; then break; fi
echo DEV=$DEV TYPE=$TYPE SEC_TYPE=$SEC_TYPE UUID=$UUID LABEL=$LABEL
unset DEV TYPE SEC_TYPE UUID LABEL
done < <(blkid)

Other thoughts:
Why is it appbrowser and appsaudit I would expect either appsbrowser or appaudit so they match.

The tce-load command could stand a slightly better help message it looks like -w & -i are options and if they
are not options why are they needed?
Usage: tce-load [ -w -i { -f } ] extname
Usage: tce-load -w -i [ -f ] extname
 -w : use wget required
 -i : install required
 -f : force
 -b : internal boot flag

Also the use of lzma for the initramfs may improve the size ~20% when I was testing and remastering
using the kernel gen_initramfs_list.sh script.
# scripts/gen_initramfs_list.sh -o /tmp/tinycore_2.7.cpio.gz ~/tinycore_2.7
# scripts/gen_initramfs_list.sh -o /tmp/tinycore_2.7.cpio.lzma ~/tinycore_2.7
# ls -l /tmp/tinycore_2.7.cpio.*
-rw-r--r-- 1 root root 8443381 2010-01-01 15:56 /tmp/tinycore_2.7.cpio.gz
-rw-r--r-- 1 root root 6992807 2010-01-01 15:56 /tmp/tinycore_2.7.cpio.lzma

I am looking forward to lzma for kernel & squashfs compression, I know it is a bit slow

I also saw that the /dev directory is populated statically gen_initramfs.sh has as a default
/dev/console & /root and the newer DEVTMPFS, busybox mdev or full udev would eliminate
those 388 files, though it would only save about 8k after gzip compression.
-rw-r--r-- 1 root root 8443050 2010-01-12 18:10 /tmp/tinycore_2.7.cpio.gz
-rw-r--r-- 1 root root 8434888 2010-01-12 18:11 /tmp/tinycore_2.7-nodev.cpio.gz
I like it because my /dev directory is much neater...

I was also thinking about compiling the initramfs in the kernel so I would have a single file
for the WinXP bootloader then I could perhaps completely skip grub.

I was also thinking about recompiling for ARM since my Zipit Z2 has 8M flash and 32M ram microcore might just fit

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: thoughts while running under user mode linux
« Reply #1 on: January 13, 2010, 06:23:11 PM »
May I assume that since you state a block device has been assigned that such devices appear in:

find /sys/block/*/ -name dev | grep -v loop

If so, it would be trivial for me to add a catch all assigned as "auto".

Or is all 'user mode' devices block major 98? In which case can be easier added along side block major 2.

The change was to answer the many bogus 'auto' devices created by prior versions, which was confusing as many reported.  Most users do not use imported Qemu virtual drives, or 'user mode' devices.  If I did, I wouldn't need feedback from the community.

Easy enough to move forward if there is proper feedback.

10+ Years Contributing to Linux Open Source Projects.

Offline jim

  • Newbie
  • *
  • Posts: 15
Re: thoughts while running under user mode linux
« Reply #2 on: January 14, 2010, 05:33:08 PM »
Yes,
I was not clear it shows up in the output as
tc@box:~$ find /sys/block/*/ -name dev | grep -v loop
/sys/block/ubda/dev.

and udev created the necessary device file
brw-r-----    1 root     staff     98,   0 Jan 14 01:12 /dev/ubda

Yes the ubd block number is 98.
In addition a second block major device number can also be assigned
and that was how I was testing the other values since 98 was not working.

My main concern was that it appears that unpartitioned devices except for MMC & floppy are not processed

I should setup a test system or two and try out some unpartitioned drives and multiple CD-ROMs like those
other people with problems had...
The unpartitioned bit was why I was looking at how blkid did the device detection.