Here's a script I modified originally its a script written by mattiadj so I gotta give him props
Here's his thread its for the Galaxy S III I think - http://forum.xda-developers.com/showthread.php?t=1772234
This will make your external SDcard as Internal and your Internal SDCard external
It mounts data/media to your extSdcard
Please make a backup before you do this, just in case.
Let me know if you have any problems
1. Anyway.. you will need to place this script in your /data folder (Yes you need to be rooted)
2. Next use ES file manager and give it 777 permission (For the non-linux users, that's full permission on it, Read, write, execute for just user)
-----------------to do this with ES file manager just press and hold down on the file and look at its properties. At the bottom you can see Permissions, hit the Change button and check-mark everything for user
3. Use Smamager (Download it if you dont have it, ... .its free) and goto the script file and open as script/execute, then when it opens choose "Is executable" and then click "Su" & "Boot". Click "Save".
4. Reboot and enjoy.
To go back to the normal setup just delete the script or open it back up in smanager and clear the SU & Boot options.
In order for some apps to function properly you will have to copy some folders from your old internal sdcard to your "New" one.
For example.. aptoide wouldnt work until the aptoide repos folder was copied over. If you want you can just copy over everything to be safe. I on the other hand just picked and chose what I needed
xalien8dx said:
2. Next use ES file manager and give it 777 permission (For the non-linux users, that's full permission on it, Read, write, execute for everyone)
-----------------to do this with ES file manager just press and hold down on the file and look at its properties. At the bottom you can see Permissions, hit the Change button and check-mark everything
Click to expand...
Click to collapse
IMO, this is terrible advice. The script is probably getting run as root, and you're opening it up to be written by anyone. Imagine if malware edited the script? Think of what malware could do if it had root access...
Sent from my Galaxy Tab 2
imnuts said:
IMO, this is terrible advice. The script is probably getting run as root, and you're opening it up to be written by anyone. Imagine if malware edited the script? Think of what malware could do if it had root access...
Sent from my Galaxy Tab 2
Click to expand...
Click to collapse
Changed it to just user read, write, execute..
thanks
So, after this what happens to the internal SdCard. Does it, or is it still being used, and if so for what...?
^ same ? and has anyone tested this and is it safe?
All this is is a modded script from mattiadj. It was written for the GS3, so I changed it to work on the 3113 tablet
Here is what it does quoted from mattiadj
My aim was to use the external sd as internal sd and the original internal sd ONLY for apps installation.
So now my 64gb external sd is used for all tasks which the internal sd was used and the original internal sd is only used for apps storage!! All extra files (resources, caches, etc etc) are stored in my external SD, which is now mounted as internal
Click to expand...
Click to collapse
The original internal sdcard is mounted by default from the system as /data/media as well as /sdcard and mnt/sdcard
so with this script it puts data/media as extSDCard and /sdcard and /mnt/sdcard are mounted to the original external SDcard
you can still access the internal SDcard from data/media or /extSDCard or mnt/extSDcard
my code
Code:
sleep 5
mount -o remount,rw /
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/sdcard
sleep 5
mount -o bind /data/media /mnt/extSdCard
this can be easily modified to work on other systems.
Hope this helps,
N8
Tried this out last night. For me it works only if run manually... After reboot, I get long "checking SD for errors" and when it actually mounts SD it gets mounted twice- as both internal sdcard and extSdCard.
Sent from my GT-P3100 using Tapatalk 2
I ran this with SCript Manager (Play Store) and it works great on my p3113. My External SD card was mounted as internal and my Internal Memory was mounted as ExternalSDcard. I am going to love having this script!
If your having problems with it mounting as your internal and external try unmounting/remounting your external card in settings under storage. Or if your skilled enough try changing the second sleep value in the script to a higher number like 10 that should fix it
Works famously. For the apps that have issues just clear data under settings and it seems to be golden.
Sent from my GT-P3113 using xda app-developers app
I haven't done anything quite like this before but I have a use in mind. My GPS program, Sygic, puts the mapset on the internal sd card. Just the Western USA states are 500 mb If I get this running, and have Sygic do it's normal install, will the mapset to to the 32 GB MicroSD card that I have?
king200 said:
I haven't done anything quite like this before but I have a use in mind. My GPS program, Sygic, puts the mapset on the internal sd card. Just the Western USA states are 500 mb If I get this running, and have Sygic do it's normal install, will the mapset to to the 32 GB MicroSD card that I have?
Click to expand...
Click to collapse
It should. For example, I use Amazon MP3 and when I downloaded a song before they went to the internal card. Now they are stored on the external. The device reads your external as though it is the internal.
Sent from my GT-P3113 using xda app-developers app
so is there Anyway on how to force this to start on boot?
Sent from my GT-P3113 using xda app-developers app
kdog48 said:
so is there Anyway on how to force this to start on boot?
Sent from my GT-P3113 using xda app-developers app
Click to expand...
Click to collapse
Yes
in script manager choose su and boot. If you follow the first post it will execute on boot. Or if you have a rom with init.d support place this script in your /etc/init.d folder, I dont have a rom with init.d support so I dont know if that would work but it should. If someone could test this and let me know I would appreciate it. Im not sure if you still have to set permissions to execute on it.
Well I've had problems downloading certain apps to SD it says insufficient memory delete 0mb of data so I actually will just manually use it haha
Sent from my GT-P3113 using xda app-developers app
Working 100% using a 32GB memory card! thanks for this!
hi guys
is applicable to 2 10.1 GalaxyTab P5100?
requires Android 4.1.1 or 4.0.4. ?
Thank you.
If this works, I will name my next born child after you!
Anyway, I would like to know if this will work on Cyangenmod 9.0.0? Or will it only work on the stock rom. I have my old stock rom of 4.0.4 saved if I need to go back... because I will if this works.
does root explorer have the 'su boot' option? never used it to run scripts...:silly:
I already used the thank link... but stilll thank you so, so much! I just recently got my 8gb 3113... needless to say, I REALLY needed some space. If any, it was a good lesson for me to definitely choose the 16GB Nexus 4.
MadDogE134 said:
does root explorer have the 'su boot' option? never used it to run scripts...:silly:
Click to expand...
Click to collapse
It's from SManager.
Related
I am using jfs rom with a2sd and I want to move a single app (lock 2.0) to my internal memory so i goes faster. How would i do this using terminal?
cookiemonster55 said:
I am using jfs rom with a2sd and I want to move a single app (lock 2.0) to my internal memory so i goes faster. How would i do this using terminal?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=512743
If you use symlink method - I would say you can not move a single app to internal memory.
If you use unionfs method - the only one way I know is to unmount app-folder folder, to copy the app there, and to mount it back. My guess - the app wouldn't work after copying It is because apps permissions changes if you copy an app (not sure). So, you can unmount the app-folder, then reinstall the app, then mount it back.
The exact commands depend if you mount the whole /data or just /data/app.
Use it at your own risk of course. But I tried it and it worked. Although, I personally prefer symlink method.
technically you can using symlinks. Although it may not be very desirable or perform any better. You can create another dir say "/data/app_local" and then copy the app from your ext2 sd partition to /data/app_local/" then create a symlink to that app. you probably won't notice any performance gain from doing that though because every time the app is run, it has to do 2 follow links and has to go through the sd card anyway. although it'll only need to read the link.
I too need this answered.
I am using the symlinks method, apps2sd2 never quite worked for me.
Please help.
you could just move that app from /data/app (or /system/sd/app) to /system/app
So has anyone been able to figure out how to use the internal memory for movies/music/pictures
I've been able to add items to the internal memory via an update.zip installed through Clockwork.
-----
Sent from my Droid X. Powered by Big Red, customized by NATF.
NotATreoFan said:
I've been able to add items to the internal memory via an update.zip installed through Clockwork.
-----
Sent from my Droid X. Powered by Big Red, customized by NATF.
Click to expand...
Click to collapse
I don't think you understood my question. but how would I install my music/movies/pics through an update file, and be able to see it in music player and gallery.
titos1997 said:
I don't think you understood my question. but how would I install my music/movies/pics through an update file, and be able to see it in music player and gallery.
Click to expand...
Click to collapse
I understood your question. I create an update.zip containing the folder structure that Android recognizes, and then I script them to install to internal memory. After rebooting, my ROM is untouched and I have the files in the internal memory.
Can you not just use root explorer to move the media files to a place on internal memory.?
Sent from my DROIDX using XDA App
monkespit said:
Can you not just use root explorer to move the media files to a place on internal memory.?
Sent from my DROIDX using XDA App
Click to expand...
Click to collapse
You can put them there with root explorer, but the only place I know of that you can put files on the internal memory is /data. If you place them anywhere else they will disappear after a reboot. I have movies on mine (with root explorer)but in order for the app (rockplayer) to see them I have to remount and chmod the /data directory. I have a very simple script in gscript to do this with as the permissions reset themselves after reboot. Here is the command:
mount -o rw,remount -t yaffs2/dev/block/mtdblock3 /data chmod 777 /data
The whole thing is a pain and the stock apps don't see the internal memory so you have to use rockplayer or vplayer to use the files. The update.zip is probably a better solution, but I would have no idea how to go about that.
Hello.
I'm using the latest aurora and I'd like to discuss an idea I had.
Since the U8800 has plenty internal memory and it's quite fast comparing to an average sd card, it'd be great if we could use the internal memory for the tasks that need "speed" instead of "space".
Running apps from the sd card is the perfect example!
So the idea would be, while keeping the external sdcard mounted on /mnt/sdcard, having /mnt/sdcard/Android/data, for instance, point to the «internal sdcard path»/Android/data.
What do you think would be the best solution:
- hacking the mount points?
- using links?
- other solution?
Any developer or filesystem savvy user can point the advantages or dangers of using this solution?
- e.g.: the system or some apps may check if the external sd-card is mounted before trying to read/write to /mnt/sdcard/Android/data... that would mean the system/those apss may think that path isn't reachable with the ext-sdcard unmounted, altough they can be read.
Suggestions? Rants? Ideas?
Regards!
I have wondered if the /data/app or maybe the whole /data partition could be mounted in the internal storage partition. That would give 2gb space for apps and associated files instead of 3-400 ish and would mean no need to move apps to sd card which would mean faster loads at startup due to internal memory being faster.
VuDuCuRSe said:
Hello.
I'm using the latest aurora and I'd like to discuss an idea I had.
Since the U8800 has plenty internal memory and it's quite fast comparing to an average sd card, it'd be great if we could use the internal memory for the tasks that need "speed" instead of "space".
Running apps from the sd card is the perfect example!
So the idea would be, while keeping the external sdcard mounted on /mnt/sdcard, having /mnt/sdcard/Android/data, for instance, point to the «internal sdcard path»/Android/data.
What do you think would be the best solution:
- hacking the mount points?
- using links?
- other solution?
Any developer or filesystem savvy user can point the advantages or dangers of using this solution?
- e.g.: the system or some apps may check if the external sd-card is mounted before trying to read/write to /mnt/sdcard/Android/data... that would mean the system/those apss may think that path isn't reachable with the ext-sdcard unmounted, altough they can be read.
Suggestions? Rants? Ideas?
Regards!
Click to expand...
Click to collapse
Well this is known for a while now . Quoted from my thread here:
vold.fstab - CHANGE THE DEFAULT SDCARD: -thanks to julle131
There is this file named vold.fstab at your /system/etc/ folder, which controls which of your sdcards (Internal/External) will be mounted when you connect your phone to the PC. The last 2 lines are the only that matter. These are the two possibilities:
EXTERNAL SDCARD MOUNTED (DEFAULT):
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.4/mmc_host
dev_mount emmc /mnt/sdcard1 14 /devices/platform/msm_sdcc.2/mmc_host
INTERNAL SDCARD MOUNTED:
dev_mount sdcard /mnt/sdcard 14 /devices/platform/msm_sdcc.2/mmc_host
dev_mount emmc /mnt/sdcard1 auto /devices/platform/msm_sdcc.4/mmc_host
change them as you wish with a root explorer or before flashing.
Click to expand...
Click to collapse
Make this change and every app will use the internal sdcard. Gallery works ok with images to external sdcard, it just might take a while for the first refresh. But I don't know if you'll notice any difference in terms of speed....
Cheers
spirosbond said:
Well this is known for a while now . Quoted from my thread here:
Make this change and every app will use the internal sdcard. Gallery works ok with images to external sdcard, it just might take a while for the first refresh. But I don't know if you'll notice any difference in terms of speed....
Cheers
Click to expand...
Click to collapse
That's not what he talked, I think. He said that the apparel would be installed on the external sd card, but the data would be moved to the internal one. And we have speed, but the main card would be the external one.
I think its a great idea if I understood it right!
Sent from my U8800 using xda premium
mrasquinho said:
That's not what he talked, I think. He said that the apparel would be installed on the external sd card, but the data would be moved to the internal one. And we have speed, but the main card would be the external one.
I think its a great idea if I understood it right!
Sent from my U8800 using xda premium
Click to expand...
Click to collapse
Oh I see! Sorry about that. As far as I know apps are not choosing were to put their data. They just say to the OS "I want these things to be at the sdcard" and the OS puts them at the correct place. So you can't "hack" the app to "see" at somewhere else. On the other hand the OS initialises on boot which card is the primary and which is the secondary. So my knowledge stops there and I can't imagine a way to make this separation between app data and the rest...
I hope for someone else's help!
PaulMilbank said:
I have wondered if the /data/app or maybe the whole /data partition could be mounted in the internal storage partition. That would give 2gb space for apps and associated files instead of 3-400 ish and would mean no need to move apps to sd card which would mean faster loads at startup due to internal memory being faster.
Click to expand...
Click to collapse
Maybe this cannot be done, because I think that the mapping of the partitions and mounts comes from the bootloader, but there is already the solution of resizing the data partition using the space of internal storage.
PaulMilbank said:
I have wondered if the /data/app or maybe the whole /data partition could be mounted in the internal storage partition. That would give 2gb space for apps and associated files instead of 3-400 ish and would mean no need to move apps to sd card which would mean faster loads at startup due to internal memory being faster.
Click to expand...
Click to collapse
That's a great idea!
I almost don't use the so called "internal sd card", therefor I have 2GB of fast empty space being wasted.
Why not simply mounting the internal sd-card partition in the data folder and the data partition on the internal sd card folder?
I only use the internal sd card to hold ringtones and other small stuff that I need to be in accessible 100% of the time, so a few hundred MB are enough!
Me gusta!
Every ROM flashes it's own fstab, right?
So all we'd need to do would be, editing the fstab before flashing it.
-----------------
Regarding the my first idea... I don't think one can simply mount a path on another path. We'd need a "virtual" device pointing to /mnt/sdcard-internal/data/ then mount that virtual device on /mnt/sdcard-external/data/.
My knowledge of unix mount/filesystems is not much more than what's explained here: https://help.ubuntu.com/community/Mount
OK, just found this:
http://askubuntu.com/questions/11079/mount-a-directory-to-look-like-a-drive
there is a FUSE filesystem named bindfs that probably does exactly what you want. For example the following:
bindfs -n /media/USB-HDD-01/ISO/ /home/johnc/ISO-images
Click to expand...
Click to collapse
would result in ISO-images to show up as a mounted filesystem in the Places sidepanel in Nautilus. The -n is required because otherwise bindfs tries to use the allow_other FUSE option, which by default is not allowed for regular users (if you use bindfs in /etc/fstab this is not a problem).
The first directory you give is the existing one, the second directory you give is an empty directory under which the contents of the existing one will appear.
Click to expand...
Click to collapse
So, bindfs depends on FUSE... and there's a port of fuse to android: https://github.com/seth-hg/fuse-android but looking at the README I get the feeling that it's not really working. The last step would be having a kernel with FUSE support... and regarding that, I have no idea, how easy it is to get a kernel like that for our U8800 :\
Finding such a solution to expand the DATA partition indirectly would be great!
I used to apply genokolar's custom partition method as "1.2G DATA + 1.46G INTERNAL SD" before, but i found out that it has some issues with Official 2.3 Roms. One of them -the most important IMHO- is the BOOTLOOP problem occurring in some specific situations!!!
See the details in my post here:
http://forum.xda-developers.com/showpost.php?p=25853141&postcount=134
(Seems that I don't encounter the bootloops on Custom Roms, but i'm not %100 sure and never will be )
So i unfortunately gave up using it, and revert to the stock partition .
I will be grateful to the one who will find a better and reliable solution. Hope to see it soon...
I still have to gather more information on the official update "modus operandi".
My goal is to simply reformat both partitions and then swap their mount points.
If the official update formats the partitions before applying the flashing official ROM files, then partitioning changes shouldn't cause any failure on the official update.
But like I said, I'm still yet to confirm that info.
Gen's idea was great (I learned a lot just by looking at his scripts) but resizing partitions has its dangers.
Since "no one" really uses the internal memory, why not simply exchange its room with /data, right?
This would be awesome! I would love to have 2gb for apps, instead of cluttering my phone.. plus the 2gb of internal storage are just a waste for me.. I never use them.. so this would be great!
Hi all,
I'm using Jelly Bean ROM on my i9100 with custom kernel.
Problem is that many apps are looking for internal memory using the path "/mnt/sdcard" (like address book export function, whatsapp for downloaded images, etc.), that should be a symbolic link to folder "/storage/sdcard0", new mount point of internal memory in JB.
I've tried SiyahKernel v4.0.1 and 4.1beta6, Dream-IRC 2.7.0 (I cannot try Dorimanx 5.65.1 cause it generates a boot loop with RootBox ROM) and all of them suffer same problem.
I've found that some init scripts (for example "fota.rc" or "init.goldfish.rc") are creating the folder "/mnt/sdcard" earlier than right init script could create symbolic link: those scripts cannot be changed cause they are part of initramfs, so kernel recompilation is needed.
I hope this thread could help kernel experts to solve problem.
Bye.
JediMaster said:
Hi all,
I'm using Jelly Bean ROM on my i9100 with custom kernel.
Problem is that many apps are looking for internal memory using the path "/mnt/sdcard" (like address book export function, whatsapp for downloaded images, etc.), that should be a symbolic link to folder "/storage/sdcard0", new mount point of internal memory in JB.
I've tried SiyahKernel v4.0.1 and 4.1beta6, Dream-IRC 2.7.0 (I cannot try Dorimanx 5.65.1 cause it generates a boot loop with RootBox ROM) and all of them suffer same problem.
I've found that some init scripts (for example "fota.rc" or "init.goldfish.rc") are creating the folder "/mnt/sdcard" earlier than right init script could create symbolic link: those scripts cannot be changed cause they are part of initramfs, so kernel recompilation is needed.
I hope this thread could help kernel experts to solve problem.
Bye.
Click to expand...
Click to collapse
._. I think this should be in the general forums?
Sent from my GT-I9100 using xda premium
MarioFan1998 said:
._. I think this should be in the general forums?
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
Hi MarioFan1998,
I've posted here cause problem is related to custom kernel recompilation, so I've thought that "Android development" was the right section: if it is not, I'll move thread to general forum, let me know.
Thank you.
Bye.
New kernels also affected...
I can confirm that also Dorimanx 5.65.1 kernel suffers same problem.
Now I've installed new Resurrection Remix 3.0.4 + Dorimanx 5.65.1 kernel and "/mnt/sdcard" is always an empty folder and not a symlink to "/storage/sdcard0" as it should be.
We need kernel Experts help!
Okay in the mean time try this I have used RemountSD app but edited the
directories likes so:
Original external SD location: /storage/sdcard0
Target external SD location: /mnt/sdcard
Now go to /mnt/sdcard you should now see your internal sdcard.
Note: the external SD location I actually put the directories of the internal SD card instead
so the internal SD will be mounted instead of external.
Press thanks if it works! Use this as a temporary solution!
EDIT: Noticed that after reboot it stops working. Recommend you remount on every boot for now.
MarioFan1998 said:
Okay in the mean time try this I have used RemountSD app but edited the
directories likes so:
Original external SD location: /storage/sdcard0
Target external SD location: /mnt/sdcard
Now go to /mnt/sdcard you should now see your internal sdcard.
Note: the external SD location I actually put the directories of the internal SD card instead
so the internal SD will be mounted instead of external.
Press thanks if it works! Use this as a temporary solution!
EDIT: Noticed that after reboot it stops working. Recommend you remount on every boot for now.
Click to expand...
Click to collapse
Thank you,
I've realized a different solution, an init.d script that, if folder /mnt/sdcard is empty, removes it at boot time and creates appropriate symlink.
I attach file to this post, it must be copied (extracted script, not tar.gz archive) to /etc/init.d, then "chown root.shell 00fixmount", then "chmod 0755 00fixmount".
It works for me in RR3.0.4 + Dorimanx Kernel 5.65.1, use it at your own risk: obviously it's a temporary workaround, until kernel developers will fix it in boot image.
Bye.
You know what you guys could do? Learn to decompile a kernel and modify initramfs yourselves! It's fun to learn.
Lack of time...
karendar said:
You know what you guys could do? Learn to decompile a kernel and modify initramfs yourselves! It's fun to learn.
Click to expand...
Click to collapse
Long ago one of my hobbies was update/configuration/recompilation of kernel on my customized Slackware distro to find best performances, today I'm using a notebook with Windoze 7...
Main problem is lack of time...
JediMaster said:
Thank you,
I've realized a different solution, an init.d script that, if folder /mnt/sdcard is empty, removes it at boot time and creates appropriate symlink.
I attach file to this post, it must be copied (extracted script, not tar.gz archive) to /etc/init.d, then "chown root.shell 00fixmount", then "chmod 0755 00fixmount".
It works for me in RR3.0.4 + Dorimanx Kernel 5.65.1, use it at your own risk: obviously it's a temporary workaround, until kernel developers will fix it in boot image.
Bye.
Click to expand...
Click to collapse
what about the external sd card.. any picture or music on it is not recognised by apps.. the builtin ones..even cwm manager.. i have to resort to quick pic and power amp
xinfinityoO said:
what about the external sd card.. any picture or music on it is not recognised by apps.. the builtin ones..even cwm manager.. i have to resort to quick pic and power amp
Click to expand...
Click to collapse
I don't use external SD card, but I see that symlink "/mnt/extSdCard" is correctly pointed to "/storage/sdcard1": which path are apps expecting to use?
Let me know.
Bye.
Whatever I try, it doesnt work. I need external_sd path for my Navigon Select and camera doesnt see sdcard.
brack11 said:
Whatever I try, it doesnt work. I need external_sd path for my Navigon Select and camera doesnt see sdcard.
Click to expand...
Click to collapse
If you want, I can try to make an init.d script to unmount internal and external sdcard devices and remount them in Gingerbread locations, but I will not be able to try, cause I don't use external sdcard...
Let me know if you wanna test.
Bye.
JediMaster said:
If you want, I can try to make an init.d script to unmount internal and external sdcard devices and remount them in Gingerbread locations, but I will not be able to try, cause I don't use external sdcard...
Let me know if you wanna test.
Bye.
Click to expand...
Click to collapse
I took the Init script from this thread and then installed ics binder from the market, configured binding from /mnt/extSdCard to /mnt/sdcard/external_sd and it did the trick, however, titanium wouldn't restore anything on sd, only on "system default"
Another thing is i don't see how jb more smooth than ics, feels the same to me and as i lose some settings for jb that i had on ics, I'm back to ics for now.
Sent from my GT-I9100 using Tapatalk 2
hi,
some apps store there data on the internal sdcard without the possibility to change the folder. i'be tried the app foldermount and could mount some foldern from the external sdcard to the internal sdcard, so the apps don't know that there store there data on /storage/sdcard1. but how can i do this without an extra app? i now that i can start scripts after android start. so i've tried this in terminal emulator
Code:
mount -o bind /storage/sdcard1/folder /storage/sdcard0/folder
but it doesn't work: "mount: Operation not permitted". how can i do this?
i use stock 4.4.2 (rooted)
gene
You missed su at the beginning of your command
Sent from my Xperia Z2 using Tapatalk
yes, thanks.
but now there is the error "bad option". whats that?
gene2 said:
yes, thanks.
but now there is the error "bad option". whats that?
Click to expand...
Click to collapse
I am using GL2SD app for that purpose. all the games data is in my sd card.
Not too sure what you are up to, but would symlinking work?
Sent from my D6503 using XDA Free mobile app
Maybe, but i think the extsd is fat32 and i'm not sure android can use ext formated sdcards. Fat32 doesn't support symbolic links.
I don't understand what 'bad option' mean.
I use Folder Mount for this purpose. It can move anything (per app obb/data)to external. Try it. if you like it... buy it (3 links max in free version)
Does require root though!
At the moment i use it too. but this is an extra app i have to install. Mounting with script should be the better way - but it doesnt work.