You are not logged in.

#1 2012-11-10 18:27:47

monolith
Member
From: Mars
Registered: 2009-10-26
Posts: 12

[Solved] empty /usr, and mount a squashfs onto it during boot

### summary

I wanted to have a empty /usr, and mount a squashfs onto it during boot.
Because I have to periodically 'freeze' current system onto a tiny usb pendrive, if you want to know.

### Here I list the points

- add 'usr' , 'fsck' , 'shutdown' to HOOKS array in mkinitcpio.conf , as Mkinitcpio#usr_as_a_separate_partition mentioned.
- add 'loop' and 'squashfs' to MODULES array in mkinitcpio.conf , to mount /usr without kernel modules in /usr.
- there may be symlink to /usr in /boot/<boot-manager> , they have to be replaced with actual file.
- use /new_root/<path> to refer the squashfs file in fstab , in my case I mounted /new_root/usr/usr.sfs to /usr

Last edited by monolith (2012-11-13 04:27:59)


where are you

Offline

#2 2012-11-10 20:48:44

chris_l
Member
Registered: 2010-12-01
Posts: 390

Re: [Solved] empty /usr, and mount a squashfs onto it during boot

I don't think I get what you mean by "trying to make use of a 1GB pendrive".
You want to create a live enviroment on your usb?


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#3 2012-11-10 21:57:48

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: [Solved] empty /usr, and mount a squashfs onto it during boot

You can compress all of /usr, just add a hook to your initramfs to get it set up/mounted it properly.

Offline

#4 2012-11-11 08:07:15

monolith
Member
From: Mars
Registered: 2009-10-26
Posts: 12

Re: [Solved] empty /usr, and mount a squashfs onto it during boot

to chris_l
Yes, that's what I want to do. Sorry for omitting too much.

to tomegun
Thanks for the hint. I was obviously on a wrong way.
As Mkinitcpio#usr_as_a_separate_partition suggests, I added 'usr fsck shutdown' to HOOKS array.
And that wasn't enough for a /usr in squashfs. I had to
- replace a few symlink to /usr with actual file in /boot/
- add 'loop' and 'squashfs' to MODULES array in mkinitcpio.conf
- use /new_root/usr/usr.sfs to refer the file in fstab

Am I on a proper way now?

Last edited by monolith (2012-11-11 09:19:03)


where are you

Offline

#5 2012-11-12 05:13:19

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] empty /usr, and mount a squashfs onto it during boot

What do you have that is symlinked from /boot to /usr?  Rather than having /usr mount over some stuff just to resolve some symlinks, why not just copy it over to /boot?

Offline

#6 2012-11-12 05:47:25

chris_l
Member
Registered: 2010-12-01
Posts: 390

Re: [Solved] empty /usr, and mount a squashfs onto it during boot

I haven't see something that is symlinked from /boot on /usr either. What is?
And by the way, if you are building an arch live usb, is there a reason you are not just using archiso ( https://wiki.archlinux.org/index.php/Archiso ) ?

I'm not criticizing by the way! If the reason is "just for the fun to hack it that way", that is a valid reason to me
(hell,"just for the fun to hack" is, to me, one of the most respetable reasons to do anything at all X3 )


"open source is about choice"
No.
Open source is about opening the source code complying with this conditions, period. The ability to choose among several packages is just a nice side effect.

Offline

#7 2012-11-12 16:25:51

monolith
Member
From: Mars
Registered: 2009-10-26
Posts: 12

Re: [Solved] empty /usr, and mount a squashfs onto it during boot

to WonderWoofy
syslinux installs a few symlinks to /usr in /boot/syslinux . Copying actual files to /boot is what I did, to use them before /usr get mounted.

to chris_l
I want to periodically 'freeze' current packages into a live usb, with a few persistent directories. At least /home /var have to be.
I believe archiso can do that, but copying from the running system is more straightforward to me.
and there is fun inside  XD


where are you

Offline

Board footer

Powered by FluxBB