how to write in root drive


ahahah

Active Member
Joined
Feb 13, 2010
Messages
592
hello

i use 2 sd cards, one for datas (32gb) and an other one to boot with (8gb).

the 8gb card show 2 drives "boot" and "root"

"boot" has a few space, but "root" has 6gb of free space and i would like to use this space.

so i wanted to copy a folder in the "root" drive but i couldn't do it.

how to do to have the possibility to write in the root drive?

(i remind it is not the nand but a sd card)

thanks
 
sudo cp -r /path/to/folder/to/copy/ /media/root/

For moving the folder, use:

sudo mv /path/to/folder/to/move/ /media/root/
 
with these commands any program could write also in the drive? (for example to create save game files)
 
No, as with sudo you have to give your rootpassword for every operation.


You can create a new folder in the partition with


sudo mkdir yourfolder


And then do a


sudo chmod -R 777 yourfolder


Then you have a folder everything can write and read.
 
Last edited by a moderator:
Can I also use chmod -R 777 for the whole SD-card/partition if "yourfolder" is /media/Sdname ?
 
Last edited by a moderator:
It will work but it is very much not recommended. Also some system tools may complain if they notice that their files aren't protected.
 
ahahah, there is some place on your root drive, that can be written to without having administrator rights (i.e. without using sudo): your home folder.

It is named

/home/YOUR_LOGIN_NAME

(Also accessible via /media/root/home/YOUR_LOGIN_NAME)

Normally, a user should store his own files only inside his home directory. There he has all access rights he needs.

Oh, of course replace YOUR_LOGIN_NAME with your actual login name that you chose on first boot.
 
What I want is:

For now I use FAT32 SD-cards as they are compatible with windows computers you see everywhere.

Maybe I could try to make my second one a EXT4 card and do some speed comparisons.

For only PNDs and storing some data don't need and want such protection.

I want to easily move PNDs and data without any sudo command into the Pandora folders (menu, appdata...).

Of course I don't want to disable protection for the NAND or so. Just for a PND and data SD.

Is this any problem?
 
The FAT filesystem doesn't have the notion of permissions, so anything on a FAT partition has full permissions for everyone (read, write, execute).

Unix-like filesystems (like ext2/3/4) do have permissions. Every file and directory has an owner and a group, and you can set read/write/execute permissions for the owner, the group, and the world (everyone).

In a standard unix filesystem, all "system" files and directories are owned by root, e.g. all files in /bin, /usr, /lib, and so on. The permissions for most of these files are set such that everyone can read the files and directories, everyone can execute the programs, but only root can write stuff. The idea is that the computer may be used by many different users, and you don't want the users to destroy the system. The only place were users can write is in /tmp and in their home folder (/home/username). Depending on how you set permissions, you can allow other users to see or not see, change or not change files and directories that you own.

See http://en.wikipedia.org/wiki/File_permission#Traditional_Unix_permissions for more information.

On a Pandora, you typically have only one user. It still makes sense to distinguish between root and the user, because that way you can be sure that you don't accidentally screw up things as long as you're logged in as the user and not as root. Of course you can use sudo or similar commands to temporarily become root if you need to.

If you have an ext2/3/4 partition that you're just using for data, it's of course not a problem to make the entire partition owned by the user so that you don't need root to write there. If you're booting from an SD card, that means that all your system files are on the SD card so you want to keep them owned by root. You can put stuff in your home directory, or if you want to have a shorter path, you can create a directory in the root and make it owned by you:

sudo mkdir /mystuff

sudo chown <your_user_name> /mystuff

If you want to store PNDs on the same partition as the one you're booting from, you can create a "pandora" directory and make it owned by yourself in the same way.
 
ahahah, there is some place on your root drive, that can be written to without having administrator rights (i.e. without using sudo): your home folder. It is named /home/YOUR_LOGIN_NAME (Also accessible via /media/root/home/YOUR_LOGIN_NAME) Normally, a user should store his own files only inside his home directory. There he has all access rights he needs.


Oh, of course replace YOUR_LOGIN_NAME with your actual login name that you chose on first boot.
good to know also.

thank you for the help
 
the root partition is invisible when i insert the sd card in windows.

is there something i can do to make it visible?

thanks
 
i don't remember how it was formatted but i don't use to format in ext2 and the boot partition is visible in windows, so i think it is fat32 formatted?
 
The boot partition is always fat32. The root one should be ext2.


You can check in gparted.
 
Last edited by a moderator:
Windows doesn't support multiple partitions on SD cards, unless that has changed recently. Even if the root partition is FAT32, it still won't work.
 
I write today in this topic because now i don't need this sd card for booting the pandora anymore. ;)

Since onlythe "boot" particion is visible with windows, i can't format the whole sd card.

The both partitions are visible with the pandora, but i don't know how to format a sd card with pandora^^

I can see the partitions as 2 drive icons on the desktop but the right-click on them doesn't show any format operation.

someone can tell me how todo please?

thanks
 
Not sure if this will work, but you could try drive management in windows 7+

Start -> type "disk management" -> click "create and format hard disk partitions" and see if you can do it that way.

D.
 
Back
Top