Blog Forum Wiki Links Contact Us NetbookUser
RunCore Pro IV SSD Transforms your ASUS EEE PC by increasing 
performance 5-40X. Your satistfaction guaranteed RunCore Pro 70mm SATA Mini PCI-e SSD
RunCore Pro IV 70mm SATA II Mini PCI-e SSD
RunCore Pro IV 2.5 Inch SATA II SSD

You are not logged in.

#1 2007-11-11 10:21:19 am

beckon
New member
Registered: 2007-11-03
Posts: 5

unionfs

So I have hit a wall with my linux skills, I would like to change the unionfs mount so that it loads both partitons as rw.

I initially thought it would just be a case of changing mtab, but even with loading another os by usb and then going into the sda1 it gives me fsync errors.

Has anyone successfully managed to change the way unionfs mounts sda1?

Offline

 

#2 2007-11-11 10:33:53 am

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

It's the initrd/init which mounts / with unionfs.
mount -t unionfs -o dirs=/mnt-user=rw:/mnt-system=ro unionfs /mnt

exec switch_root /mnt $INIT </mnt/dev/null >/mnt/dev/null


And be carreful to the fastinit executable, it deals with unionfs (/sbin/unionctl.static / --remove / > /dev/null 2>&1, ...)

Remember, EEE DOESN'T use the init sysV boot process.

mtab is not the right file neither (symlink to /proc/mount), it's fstab.

Last edited by Kibobo (2007-11-11 10:50:42 am)

Offline

 

#3 2007-11-11 2:34:39 pm

eFfeM
Senior Member
Registered: 2007-10-21
Posts: 861
Website

Re: unionfs

note that initrd/init is executed from /dev/sda1 before the union is made. You cannot easily change that


All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours smile

Offline

 

#4 2007-11-11 2:53:46 pm

mkrishnan
Moderator
From: Chicago, IL, USA
Registered: 2007-11-06
Posts: 3433

Re: unionfs

You should be able to do it if you boot off a USB drive. But how do you reconcile the existing changes that were created by putting replacement versions of files in sda2?


Mohan

Offline

 

#5 2007-11-11 4:06:22 pm

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

eFfeM wrote:

note that initrd/init is executed from /dev/sda1 before the union is made. You cannot easily change that

Just make an other initramfs (cpio/gz) and add an entry in the grub menu, that's all.
You just have to change one file (init).

I'll try, tomorow, to merge the two fs in a read-write one to see if the fastinit executable can deal with that.

Last edited by Kibobo (2007-11-11 4:08:11 pm)

Offline

 

#6 2007-11-12 2:07:33 am

drfrog666
Senior Member
From: vancouver bc canada
Registered: 2007-11-08
Posts: 136

Re: unionfs

hey some interesting things popped up when i wss looking for info on why updatedb is so wack

basically you have to add /UNIONFS to your path

but in my google searching i bumped into this:

http://lkml.org/lkml/2007/1/12/58

which is not good, it mean if one wants to use multiuser with the default xandros its a bad thing

Offline

 

#7 2007-11-12 9:26:35 am

Qatz
Senior Member
From: In your hair.
Registered: 2007-08-27
Posts: 212

Re: unionfs

Kibobo wrote:

eFfeM wrote:

note that initrd/init is executed from /dev/sda1 before the union is made. You cannot easily change that

Just make an other initramfs (cpio/gz) and add an entry in the grub menu, that's all.
You just have to change one file (init).

I'll try, tomorow, to merge the two fs in a read-write one to see if the fastinit executable can deal with that.

the grub config menu is also on sda1. I've also found that sda1 is "resistant" to mounting(or remounting) while oddly enough sda2 can be mounted just fine.


Beer?
4G White 701a with Flash PCI-E Slot | 2 gig Ram | Gentoo | Kernel 2.6.25.4

Offline

 

#8 2007-11-12 10:26:08 am

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

Edit grub file with the rescue console.
http://www.blogeee.net/forum/viewtopic.php?t=275

Last edited by Kibobo (2007-11-12 10:26:54 am)

Offline

 

#9 2007-11-12 10:44:34 am

Gadgetguy
Senior Member
From: Oakville, ON, Canada
Registered: 2007-10-29
Posts: 129

Re: unionfs

Kibobo wrote:

eFfeM wrote:

note that initrd/init is executed from /dev/sda1 before the union is made. You cannot easily change that

Just make an other initramfs (cpio/gz) and add an entry in the grub menu, that's all.
You just have to change one file (init).

I'll try, tomorow, to merge the two fs in a read-write one to see if the fastinit executable can deal with that.

Kibobo,

could you please give us the actual init and/or grub file you have created? It would be much easier to replicate for beginners (like myself)

Offline

 

#10 2007-11-12 1:06:11 pm

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

http://img409.imageshack.us/img409/8578/bootdf8.th.png
http://img111.imageshack.us/img111/1727/unionsx9.th.png http://img252.imageshack.us/img252/5723/union2ah3.th.png
http://img240.imageshack.us/img240/5343/union3vk2.th.png http://img155.imageshack.us/img155/9026/union4fi1.th.png


bye bye unionfs wink

It's with a virtual machine but it should work on EEE.

Last edited by Kibobo (2007-11-12 4:16:07 pm)

Offline

 

#11 2007-11-12 1:28:46 pm

Gadgetguy
Senior Member
From: Oakville, ON, Canada
Registered: 2007-10-29
Posts: 129

Re: unionfs

Kibobo wrote:

bye bye unionfs wink

Is it possible to remove unionfs completely by using your approach? That would be ideal!!!

Offline

 

#12 2007-11-12 1:31:55 pm

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

unionfs is completely removed.

Make a restore DVD without unionfs is pretty easy too.

Last edited by Kibobo (2007-11-12 1:33:24 pm)

Offline

 

#13 2007-11-12 1:33:48 pm

Gadgetguy
Senior Member
From: Oakville, ON, Canada
Registered: 2007-10-29
Posts: 129

Re: unionfs

Kibobo wrote:

unionfs is completely removed.

Details please.... I want to remove all those unnecessary apps to have space for other things...

Thank you so much for your advice!

Last edited by Gadgetguy (2007-11-12 1:34:06 pm)

Offline

 

#14 2007-11-12 2:06:22 pm

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

My initrd/init file:

Code:

#!/bin/sh
mount -t proc proc /proc

if [ -n "$XANDROSBOOTDEBUG" ]; then
    /bin/busybox sh
    set -x
fi

ROOT=`cat /proc/cmdline | sed 's/.*root=// ; s/ .*//'`
#VERSION=`cat /proc/version | cut -f3 -d" "`

mount -t ext2 -o rw $ROOT /mnt
if [ $? -ne 0 ] ; then
    echo Could not mount OS on $ROOT. Starting debugging shell....
    /bin/busybox sh
fi

#if [ -n "$XANDROSSCAN" ]; then
#    exec switch_root /mnt-system /sbin/scanuser.sh
#fi

#if [ -n "$XANDROSRESTORE" ]; then
#    exec switch_root /mnt-system /sbin/formatuser.sh
#fi

#if [ -z "`grep nosplash /proc/cmdline`" ]; then
#    echo -n ""
#    cp /mnt-system/boot/startup.fb /dev/fb/0
#fi

#if ! mount -t ext3 -o rw /dev/sda2 /mnt-user; then
#    echo Error mounting user partition. Must run filesystem scan!
#    exec switch_root /mnt-system /sbin/scanuser.sh
#fi

# Factory auto-format functionality
#if [ -f /mnt-user/.autoformat ]; then
#    umount /mnt-user
#    exec switch_root /mnt-system /sbin/formatuser.sh -- --auto
#fi

#insmod /mnt-system/lib/modules/$VERSION/kernel/fs/unionfs/unionfs.ko > /dev/null

#mount -t unionfs -o dirs=/mnt-user=rw:/mnt-system=ro unionfs /mnt
#if [ $? -ne 0 ]; then
#    echo Could not mount unionfs. Starting debugging shell....
#    /bin/busybox sh
#fi

#mount --move /mnt-system /mnt/mnt
#umount -l /mnt-user

umount /proc

if [ -n "$INIT" ]; then
    if [ -n "$XANDROSBOOTDEBUG" ]; then
    exec switch_root /mnt $INIT </mnt/dev/console >/mnt/dev/console
    else
    exec switch_root /mnt $INIT </mnt/dev/null >/mnt/dev/null
    fi
else
    exec switch_root /mnt /sbin/fastinit "$@" </mnt/dev/console >/mnt/dev/console
fi

echo
echo Init Failed. Starting emergency shell....
/bin/busybox sh

To extract initramfs:

Code:

gunzip initramfs-eeepc.gz
cpio -iF initramfs-eeepc

To rebuild initramfs:

Code:

cd /boot/initramfs
find | cpio -H newc -o | gzip -9 > ../initramfs-wunion.img

And add the new grub line

Code:

title New Boot
        root (0x80,0)
        kernel /boot/vmlinuz-2.6.21.4-eeepc quiet rw vga=785 irqpoll root=/dev/sda1
        initrd /boot/initramfs-wunion.img

You can also copy your files in sda2 to sda1, change ext2 to ext3 and resize sda1.

Have fun !

Last edited by Kibobo (2007-11-12 2:07:40 pm)

Offline

 

#15 2007-11-12 3:25:49 pm

eFfeM
Senior Member
Registered: 2007-10-21
Posts: 861
Website

Re: unionfs

nice kibobo,

I didn't come to sorting that out yet.
Can someone put this in the wiki (don't have the time to do that myself right now)


All opinions, information etc in this forum post is copyrighted by me (eFfeM) unless indicated otherwise.
You are free to reuse whatever you want to, provided that:
1) you give credit to me and eeeuser.com whenever you reuse anything for all things you reused.
2) you do not pretend or create the illusion that your modifications are mine. I'll be responsible for my junk, you for yours smile

Offline

 

#16 2007-11-12 3:45:35 pm

Gadgetguy
Senior Member
From: Oakville, ON, Canada
Registered: 2007-10-29
Posts: 129

Re: unionfs

Thank you Kikobo!!!

Is it fair to assume, that if I were to boot the eeePC from CD, using Knoppix, I could modify initrd/init without having to touch initramfs?

So I would need to modify only that one file (using the details you provided), right?

Thanks again,

Miklos

Last edited by Gadgetguy (2007-11-12 3:56:24 pm)

Offline

 

#17 2007-11-12 4:10:21 pm

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

initrd/init IS initramfs.
I have just commented and modified one or two lines of init file.

No need to knoppix or something, extract and modify initramfs file with xandros, rebuild, save the result (actually on sda2), reboot on rescue console, mount sda1 and sda2 (/mnt-system, /mnt-user), copy initramfs from sda2 to sda1, modify menu.lst, reboot.

Last edited by Kibobo (2007-11-12 4:13:29 pm)

Offline

 

#18 2007-11-12 4:18:06 pm

Gadgetguy
Senior Member
From: Oakville, ON, Canada
Registered: 2007-10-29
Posts: 129

Re: unionfs

Kibobo wrote:

initrd/init IS initramfs.
I have just commented and modified one or two lines of init file.

No need to knoppix or something, extract and modify initramfs file with xandros, rebuild, save the result (actually on sda2), reboot on rescue console, mount sda1 and sda2 (/mnt-system, /mnt-user), copy initramfs from sda2 to sda1, modify menu.lst, reboot.

Thank you for the clarification.

Offline

 

#19 2007-11-12 5:23:52 pm

Gadgetguy
Senior Member
From: Oakville, ON, Canada
Registered: 2007-10-29
Posts: 129

Re: unionfs

Apparently modifying menu.lst does nothing ( see here: http://forum.eeeuser.com/viewtopic.php?id=581), as the grub menu is probably hardcoded in the source code.

Kikobo, is modifying menu.lst necessery for your hack to work?

Offline

 

#20 2007-11-12 6:15:30 pm

Qatz
Senior Member
From: In your hair.
Registered: 2007-08-27
Posts: 212

Re: unionfs

The reason menu.lst isn't doing anything is because grub gets it from sda1 not sda2, and when you edit the file from Xandros it saves it to sda2. To use Kibobo's  mods you do need to boot from a different disc(Or disk)


Beer?
4G White 701a with Flash PCI-E Slot | 2 gig Ram | Gentoo | Kernel 2.6.25.4

Offline

 

#21 2007-11-13 2:40:24 am

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

Have you read my post ?
No need to external distro, there is a rescue console.

Gadgetguy: you must edit menu.lst to add the new initramfs file. You can also edit the command line at the grub prompt (press e).

Last edited by Kibobo (2007-11-13 2:44:20 am)

Offline

 

#22 2007-11-13 2:56:13 am

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

If someone wants to write a tutorial to make a restore DVD without unionfs, do it smile I have no time yet.

Offline

 

#23 2007-11-13 8:52:52 am

Qatz
Senior Member
From: In your hair.
Registered: 2007-08-27
Posts: 212

Re: unionfs

Kibobo wrote:

Have you read my post ?
No need to external distro, there is a rescue console.

Gadgetguy: you must edit menu.lst to add the new initramfs file. You can also edit the command line at the grub prompt (press e).

You mean the one here? http://www.blogeee.net/forum/viewtopic.php?t=275 Sorry my French is a bit limited so I missed the recovery boot method.


Beer?
4G White 701a with Flash PCI-E Slot | 2 gig Ram | Gentoo | Kernel 2.6.25.4

Offline

 

#24 2007-11-13 9:07:50 am

Kibobo
Senior Member
From: France
Registered: 2007-10-21
Posts: 295
Website

Re: unionfs

Not easy to understand ?
The important things are in english: text in bold, the code and the screenshot.

If you want, you can make a topic in english or in the wiki wink

Last edited by Kibobo (2007-11-13 9:09:09 am)

Offline

 

#25 2007-11-14 10:04:34 pm

pkwong
Member
Registered: 2007-11-13
Posts: 12

Re: unionfs

i'm trying to install debian on the SD

i followed your method and booted
it stopped after
mount -t ext2 -o rw $ROOT /mnt

i checked /dev, but only sda(the SSD) is found...
do i have to plug any modules for the sd drive to work?

one weird thing, i have only 1 partition on sda, but it showed sda2 and sda3
so i tried mknod -m 644 /dev/sdb1 b 8 1
but it said mount: Mounting /dev/sdb1 on /mnt failed: Invalid argument
can you give me some advice to go on? thanks!

Offline

 

Board footer

Powered by PunBB 1.2.15
© Copyright 2002–2005 Rickard Andersson