[HOW-TO]overcame 4GB fatx limitation here

Ask questions regarding Gentoox, Gentoo and Linux in general in these forums and we'll do our best to help you!
lollo78
Newbie
Posts: 5
Joined: Wed Feb 23, 2005 5:52 pm

[HOW-TO]overcame 4GB fatx limitation here

Post by lollo78 »

Hi fist i want to thank Shallax for his great work
I will explain how to get a big partition (bigger than 4GB) without a native install (no need to flash or reinstall and you can keep your games too :) )
I will not use raid software (it doesn't work with loopfiles) instead i wll use LVM.
First i strongly recommend to backup those files
rootfs vmlinuz swap (on E partition)
You can't just run "emerge lvm2" you need to play with your kernel(you need kernel 2.4.22 check yours using "uname -r" if it doesn't match run magic to update)
Download this
ftp://sources.redhat.com/pub/dm/device- ... .00.21.tgz
put it in /usr/src

Code: Select all

cd /usr/src/
tar xvzf device-mapper.1.00.21.tgz
cd linux
patch -p1 < /usr/src/device-mapper.1.00.21/patches/linux-2.4.26-rc1-devmapper-ioctl.patch
Run "make xconfig" this will open a GUI
set code maturity level option to yes
--return main menu---
OPEN multi-device support
set yes the following:
multiple device driver support
logical volume manager support
device-mapper support
SAVE AND EXIT
Next command will take some times(1 hour ?)

Code: Select all

make dep
make bzImage
make modules
make modules_install
Copy bzImage to E partition and rename to vmlinuz(overwriting the old one).
Reboot (you will get some errors with audio just run "magic fix alsa && magic)

Now install LVM2

Code: Select all

emerge lvm2
Now let's make some loops(magic newfs doesn't work PVs become corrupted after reboot)

Code: Select all

dd if=/dev/zero of=/mnt/fatx/f/part1di5 count=4000 bs=1024k
Repeat previous for each loops you want just change name(part2di5...)

Next

Code: Select all

losetup /dev/loop/1 /mnt/fatx/f/part1di5
Repeat previous for each loops just change ...loop/2...part2di5

Format loops

Code: Select all

mkfs.ext3 -j /dev/loop1
Repeat for each loop

This isn't necessary (i think) just do it

Code: Select all

tune2fs -i0 -c0 /dev/loop1
Repeat for each loop

Use lvm

Code: Select all

pvcreate /dev/loop1
Repeat for each loop

Create volume group

Code: Select all

vgcreate opt /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5
Add all your loops

Create logic volume (run "vgdisplay" and check Total PE mine is 4995 use yours)

Code: Select all

lvcreate -l4995 -noptfs opt
mkfs.ext3 -j /dev/opt/optfs
Volume is formatted

Create a script and update boot sequence

Code: Select all

mkdir /mnt/raidone
cd /etc/init.d
nano loopback
Insert this script

Code: Select all

#!/sbin/runscript
  start() {
             ebegin "Attaching loopback filesystem for LVM partition"
             losetup /dev/loop/1 /mnt/fatx/f/part1di5
             losetup /dev/loop/2 /mnt/fatx/f/part2di5
             losetup /dev/loop/3 /mnt/fatx/f/part3di5
             losetup /dev/loop/4 /mnt/fatx/f/part4di5
             losetup /dev/loop/5 /mnt/fatx/f/part5di5
             vgchange -a y opt
             mount /dev/opt/optfs /mnt/raidone
             }
Obviously add all your loopfiles
Save exit
and make loopback executables

Code: Select all

chmod a=+r+w+x loopback
Update boot

Code: Select all

rc-update -a loopback boot
IT'S DONE.
Reboot and you can access your partition from /mnt/raidone
I hope this will be useful for someone

I'm just a noob so my thanx go to:
http://evms.sourceforge.net/install/
http://www.gentoo.it/handbook/hb_part2_chap5.html
http://www.tldp.org/HOWTO/LVM-HOWTO/
This was really useful
http://xbox-linux.sourceforge.net/cgi-b ... Partitions

Feedbacks and corrections appreciated
Bye :)

P.S. If you have a kernel from 2.4.22 to 2.4.29 this tutorial should work
If you have a 2.6 kernel you don't need need to patch.
lollo78
Newbie
Posts: 5
Joined: Wed Feb 23, 2005 5:52 pm

Specification

Post by lollo78 »

When i say copy bzImage on E i mean this one:
/usr/src/linux/arch/i386/boot/bzImage
Sorry
ShALLaX
Site Admin
Posts: 1973
Joined: Sun Aug 10, 2003 9:25 pm
Location: England
Contact:

Post by ShALLaX »

Very good work!
The original Xbox adaptation of Gentoo
lollo78
Newbie
Posts: 5
Joined: Wed Feb 23, 2005 5:52 pm

Post by lollo78 »

ShALLaX wrote:Very good work!
Thank you.
What do you think about a script ?
I'd love a script with my name :)

Code: Select all

magic lollo .....
Heheheheh
Just kidding
Bye
ShALLaX
Site Admin
Posts: 1973
Joined: Sun Aug 10, 2003 9:25 pm
Location: England
Contact:

Post by ShALLaX »

Hrm, surely it should be

device-mapper.1.00.21/patches/linux-2.4.22-devmapper-ioctl.patch

not

device-mapper.1.00.21/patches/linux-2.4.26-rc1-devmapper-ioctl.patch

?
The original Xbox adaptation of Gentoo
lollo78
Newbie
Posts: 5
Joined: Wed Feb 23, 2005 5:52 pm

Post by lollo78 »

ShALLaX wrote:Hrm, surely it should be

device-mapper.1.00.21/patches/linux-2.4.22-devmapper-ioctl.patch

not

device-mapper.1.00.21/patches/linux-2.4.26-rc1-devmapper-ioctl.patch

?
I used 2.4.26 and it worked on my 2.4.22 kernel
I followed this tutorial:
http://evms.sourceforge.net/install/kernel.html
It says for kernel 2.4.22 to 2.4.29

Code: Select all

patch -p1 < /usr/src/device-mapper.1.00.21/patches/linux-2.4.26-rc1-devmapper-ioctl.patch
Try :)
ShALLaX
Site Admin
Posts: 1973
Joined: Sun Aug 10, 2003 9:25 pm
Location: England
Contact:

Post by ShALLaX »

I tried 2.4.22 and it worked *shrugs*
The original Xbox adaptation of Gentoo
nasdak
Newbie
Posts: 5
Joined: Thu Aug 11, 2005 5:49 pm

Post by nasdak »

i tried your tutorial
everything works fine!
thanks a lot dude :)
ReaperDFB
Newbie
Posts: 8
Joined: Mon Aug 29, 2005 9:43 am

Post by ReaperDFB »

to bad that i am a total linux newbie

mhm can someone explain me step 4 step wath i shall do this version is target on a linux user how know how to creat a sscript and wher e he need to place it and its not for "newbies" like me but it seems its the online method for a big linux partition inside my dashboard i got a 300 gb hdd and want a linux with 60-80 gb size

i know asking for a step by step explanation is much but i want do and understand it if someone would be so kind i would be REALY happy
flashram
Newbie
Posts: 6
Joined: Sun Sep 25, 2005 10:08 pm

Post by flashram »

here comes a loll1 >>>first part >>

Code: Select all

lollo1
#
#don't run this as ssh user .. use VNC if u wanne do this remote
#this needs x-gfx acces



# here comes kernell check !!!
# http://evms.sourceforge.net/install/kernel.html 
# It says for kernel 2.4.22 to 2.4.29 
# if [ "`uname -r`" = "2.4.29-lame-ass-patch" ]; then
# echo IT MATCHES
# fi

cd /usr/src/ 
wget ftp://sources.redhat.com/pub/dm/device-mapper.1.00.21.tgz
tar xvzf device-mapper.1.00.21.tgz 
cd linux 
patch -p1 < /usr/src/device-mapper.1.00.21/patches/linux-2.4.26-rc1-devmapper-ioctl.patch 

# this is the line needing gfx x-userinterface ... reason why u can't do this ssh
# but VNC is good :D
make xconfig

#this step will take an hour or so ... so go watch some a movie or something
make dep 
make bzImage 
make modules 
make modules_install 

cp /usr/src/linux/arch/i386/boot/bzImage /mnt/fatx/e/vmlinuz

#countdown to reboot ?
reboot
#going for reboot
#launch lollo2 to continue after this
and the lollo2

Code: Select all

lollo2

#fix sound
magic fix alsa && magic
#install LVM2
emerge lvm2 


##HMANY="seq 20" to get 80GB

for i in `seq 20`; do
dd if=/dev/zero of=/mnt/fatx/f/rumble${i}di20 count=4000 bs=1024k;
done

for i in `seq 20`; do
losetup /dev/loop/${i} /mnt/fatx/f/part${i}di20 
done


for i in `seq 20`; do
losetup /dev/loop/${i} /mnt/fatx/f/part${i}di20 
done

for i in `seq 20`; do
mkfs.ext3 -j /dev/loop${i}
done

for i in `seq 20`; do
tune2fs -i0 -c0 /dev/loop${i}
done

for i in `seq 20`; do
pvcreate /dev/loop${i}
done

vgcreate opt /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 

/dev/loop8 /dev/loop9 /dev/loop10 /dev/loop11 /dev/loop12 /dev/loop13 /dev/loop14 

/dev/loop15 /dev/loop16 /dev/loop17 /dev/loop18 /dev/loop19 /dev/loop20

lvcreate -l4995 -noptfs opt 
mkfs.ext3 -j /dev/opt/optfs 


mkdir /mnt/raidone 
cd /etc/init.d 





nano loopback 
#and insert this
#!/sbin/runscript 
  start() { 
             ebegin "Attaching loopback filesystem for LVM partition" 
             losetup /dev/loop/1 /mnt/fatx/f/part1di20 
             losetup /dev/loop/2 /mnt/fatx/f/part2di20 
             losetup /dev/loop/3 /mnt/fatx/f/part3di20 
             losetup /dev/loop/4 /mnt/fatx/f/part4di20 
             losetup /dev/loop/5 /mnt/fatx/f/part5di20 
             losetup /dev/loop/5 /mnt/fatx/f/part6di20
             losetup /dev/loop/5 /mnt/fatx/f/part7di20
             losetup /dev/loop/5 /mnt/fatx/f/part8di20
             losetup /dev/loop/5 /mnt/fatx/f/part9di20
             losetup /dev/loop/5 /mnt/fatx/f/part10di20
             losetup /dev/loop/5 /mnt/fatx/f/part11di20
             losetup /dev/loop/5 /mnt/fatx/f/part12di20
             losetup /dev/loop/5 /mnt/fatx/f/part13di20
             losetup /dev/loop/5 /mnt/fatx/f/part14di20
             losetup /dev/loop/5 /mnt/fatx/f/part15di20
             losetup /dev/loop/5 /mnt/fatx/f/part16di20
             losetup /dev/loop/5 /mnt/fatx/f/part17di20
             losetup /dev/loop/5 /mnt/fatx/f/part18di20
             losetup /dev/loop/5 /mnt/fatx/f/part19di20
             losetup /dev/loop/5 /mnt/fatx/f/part20di20
             vgchange -a y opt 
             mount /dev/opt/optfs /mnt/raidone 
             } 
#after close and save


chmod a=+r+w+x loopback 


#update boot
rc-update -a loopback boot 


#ready for a boot ?
reboot
that would be it ... alltho it needs work ;)
flashram
Newbie
Posts: 6
Joined: Sun Sep 25, 2005 10:08 pm

Post by flashram »

euhm ... seem that this

Code: Select all

for i in `seq 20`; do 
losetup /dev/loop/${i} /mnt/fatx/f/part${i}di20 
done 
stands twice in lollo2

alltho it's only needed once >> remove second
flashram
Newbie
Posts: 6
Joined: Sun Sep 25, 2005 10:08 pm

Post by flashram »

i would also advise ... to do this manually after this code

Code: Select all

mkdir /mnt/raidone 
cd /etc/init.d 
cuz it needs u to open nano ...and save a file there
/etc/init.d

or to make some script yourself to inject
that code into loopback

Code: Select all

#!/sbin/runscript 
  start() { 
             ebegin "Attaching loopback filesystem for LVM partition" 
             losetup /dev/loop/1 /mnt/fatx/f/part1di20 
             losetup /dev/loop/2 /mnt/fatx/f/part2di20 
             losetup /dev/loop/3 /mnt/fatx/f/part3di20 
             losetup /dev/loop/4 /mnt/fatx/f/part4di20 
             losetup /dev/loop/5 /mnt/fatx/f/part5di20 
             losetup /dev/loop/5 /mnt/fatx/f/part6di20 
             losetup /dev/loop/5 /mnt/fatx/f/part7di20 
             losetup /dev/loop/5 /mnt/fatx/f/part8di20 
             losetup /dev/loop/5 /mnt/fatx/f/part9di20 
             losetup /dev/loop/5 /mnt/fatx/f/part10di20 
             losetup /dev/loop/5 /mnt/fatx/f/part11di20 
             losetup /dev/loop/5 /mnt/fatx/f/part12di20 
             losetup /dev/loop/5 /mnt/fatx/f/part13di20 
             losetup /dev/loop/5 /mnt/fatx/f/part14di20 
             losetup /dev/loop/5 /mnt/fatx/f/part15di20 
             losetup /dev/loop/5 /mnt/fatx/f/part16di20 
             losetup /dev/loop/5 /mnt/fatx/f/part17di20 
             losetup /dev/loop/5 /mnt/fatx/f/part18di20 
             losetup /dev/loop/5 /mnt/fatx/f/part19di20 
             losetup /dev/loop/5 /mnt/fatx/f/part20di20 
             vgchange -a y opt 
             mount /dev/opt/optfs /mnt/raidone 
             } 
#after close and save 
flashram
Newbie
Posts: 6
Joined: Sun Sep 25, 2005 10:08 pm

Post by flashram »

[00:59] <flashram> vgcreate opt /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/loop8 /dev/loop9 /dev/loop10 /dev/loop11 /dev/loop12 /dev/loop13 /dev/loop14 /dev/loop15 /dev/loop16 /dev/loop17 /dev/loop18 /dev/loop19 /dev/loop20
[01:00] <flashram> frpù loop 7 is' over ... a fuckin sapce to many

hope i can repair o0

also next bash script fix ...

Code: Select all

for i in `seq 20`; do
dd if=/dev/zero of=/mnt/fatx/f/rumble${i}di20 count=4000 bs=1024k;
done

for i in `seq 20`; do
losetup /dev/loop/${i} /mnt/fatx/f/rumble${i}di20 
done

watch the part changed in rumble
cheers
flashram
Newbie
Posts: 6
Joined: Sun Sep 25, 2005 10:08 pm

Post by flashram »

Deactivate the volume group:
# vgchange -a n my_volume_group
Now you actually remove the volume group:
# vgremove my_volume_group

... if the following command failed

Code: Select all

vgcreate opt /dev/loop1 /dev/loop2 /dev/loop3 /dev/loop4 /dev/loop5 /dev/loop6 /dev/loop7 /dev/loop8 /dev/loop9 /dev/loop10 /dev/loop11 /dev/loop12 /dev/loop13 /dev/loop14 /dev/loop15 /dev/loop16 /dev/loop17 /dev/loop18 /dev/loop19 /dev/loop20
becuz of spacing ... __ after 07 and 14 in first post
flashram
Newbie
Posts: 6
Joined: Sun Sep 25, 2005 10:08 pm

Post by flashram »

now ... if u screw up ... like i did the first time ... just do

Code: Select all

#make xconfig
#same as xconfig is make menuconfig but then u don't need x and can do it  via ssh
make menuconfig
#this step will take an hour or so ... so go watch some a movie or something
make dep 
make bzImage 
make modules 
make modules_install 

cp /usr/src/linux/arch/i386/boot/bzImage /mnt/fatx/e/vmlinuz

#countdown to reboot ?
reboot
#going for reboot
#launch lollo2 to continue after this..after reboot
and then it is deinstalled
if u undo the changes u did earlier

Run "make xconfig" this will open a GUI
set code maturity level option to yes
--return main menu---
OPEN multi-device support
set yes the following:
multiple device driver support
logical volume manager support
device-mapper support
SAVE AND EXIT


so just change them to off ...

or is it bette to just emerge LVM2 ... from lollo2 ?
so that u wouldn't have the need to uninstall the device-mapper in kernel ? o0

anyways thkx for the help ... also i wanted to know ... if there is a way to use something else then /dev/loopx .... like dev/whatever ? o0 thkx ;)
cheers
Post Reply