Open main menu

CDOT Wiki β

Changes

Raspberry Pi Fedora Remix Administration

4,224 bytes added, 13:44, 18 September 2012
Adding Swap Space
The "root" user has full privilege -- she can do anything. There are four ways to gain root privilege:
# '''Login as "root" and enter the root password.''' This is useful when you can't log in as any other user. It is unwise to run applications as root unnecessarily -- for example, if you run a web browser as root, and a remote site exploits a security bug in the browser, then running the browser as root could enable the remote attacker could add or remove software or perform other administrative tasks.# '''Use a graphical an application that is hooked into the ''consolehelper'' system''', such as <code>system-config-network</code>. You will be prompted for a password (either the user password or the root password, depending on the application configuration) and then the application will run with enhanced privilege. Most of the applications on the Administration menu in the graphical interface work this way.
# '''Use the "su" command to switch users''' (by default, it will switch to the root user). Type <code>su</code> and press enter, and enter the root password when prompted. This is useful when you have a number of system administration commands you want to run in a row. However, you must remember to switch back to your regular user account as soon as you no longer require privilege -- to do so, type <code>exit</code> or press Ctrl-D (for "Done"!).
# '''Use the <code>sudo</code> command to switch users for the duration of one command.'''
=== Package Management Using the Graphical User Interface ===
To update software graphically, use the menu option Administration > Software Update Software.
To add/remove software graphically, use the menu option Administration > Add and Remove Software.
== Adding and removing Users ==
* Add a user:
** <code>useradd ''name''</code> # The -m option required on some systems is not needed - the user's home directory will be created automatically.1
** <code>useradd -c "''Full Name''" ''username''</code>
* Set a password:
To manage users graphically, use the menu option Administration > Users and Groups
= Raspberry-Pi Specific Configuration = Adding Swap Space ==
The Raspberry Pi Fedora Remix 14 doesn't provision swap space by default. If you wish to add swap space, you can easily do so:* Create an empty file using the <code>dd</code> (device-to-device copy) command: <code>dd if=/dev/zero of=/swap0 bs=1M count=512</code> # This is for a 512 MB swap space.* Format the file for use as swap: <code>mkswap /swap0</code>* Add the swap file to the system configuration: <code>echo "/swap0 swap swap" >>/etc/fstab</code>* Activate the swap space: <code>swapon -a</code> == Moving to a Larger SD Card == You can copy the contents of the SD card to a larger card using the <code>dd</code> command, either on the Raspberry Pi (using an external USB SD card reader/writer) or on another computer. To do this on the Pi itself (assuming that the USB card reader is the only USB-attached storage device and therefore identified as <code>/dev/sda</code>):# Copy the data: <code>dd if=/dev/mmcblk0 of=/dev/sda</code># Force the data to be written to the SD card (flush the buffers): <code>sync</code># Remove and reinsert the SD card.# Since the SD card was copied while the system was in use, the filesystems will be marked as "dirty". Check and clean the filesystems: <code>fsck -f /dev/sda1; fsck -f /dev/sda2</code> To make the card resize the second partition the first time the new card is booted:# Mount the second partition: <code>mkdir /mnt/sd-p2; mount /dev/sda2 /mnt/sd-p2</code># Create the empty file <code>/.autoresize</code>: <code>touch /mnt/sd-p2/.autoresize</code># Unmount the partition: <code>umount /mnt/sd-p2</code> = Raspberry Pi-Specific Configuration = The first (FAT) partition on the SD card is mounted as <code>/boot</code>. There area couple of things specific to the Raspberry Pi that can be done in this partition. == Changing the Memory Mix == The Raspberry Pi (model A or B) ships with 256M of memory. This memory is split between the ARM and GPU halves of the System-on-a-Chip (SOC). You can change the memory allocation by selecting a different start.elf program: * For a 128M ARM / 128M GPU split (heavy graphics): <code>cp /boot/arm128_start.elf /boot/start.elf</code>* For a 192M ARM / 64M GPU split (general computing): <code>cp /boot/arm192_start.elf /boot/start.elf</code>* For a 224M ARM / 32M GPU split (simple display): <code>cp /boot/arm224_start.elf /boot/start.elf</code> Then reboot the system. == Altering the Kernel Command Line == The file <code>/boot/cmdline.txt</code> contains the kernel command line. The default contents are:  dwc_otg.lpm_enable=0 console=ttyAMAO,115200 kgdboc=ttyAMAO,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait === Reducing Kernel Messages === The number of kernel messages produced can be reduced by adding "quiet" to the command line. === Using a USB Drive for Storage === Although the boot files must be on the SD card, the Linux filesystem may be on an external drive. To use such an external drive:# Obtain a USB disk drive and attach it to your Raspberry Pi.# Create a partition at least as large as the second partition on the SD card using the <code>fdisk</code> command. In this example, it's assumed that this partition is the first one on the USB disk (<code>/dev/sda1</code>).# Copy the contents of the second SD card partition to the disk drive: <code>dd if=/dev/mmcblk0p2 of=/dev/sda''1''</code># Since the copy was made of the SD card while it was in use, the filesystem copy on the hard disk will be marked as "dirty". Use the filesystem check command to check and clean it: <code>fsck -y -f /dev/sda''1''</code># Edit <code>/boot/cmdline.txt</code> to change the root device: <code>root=/dev/sda1</code># You should now be able to boot to your USB disk drive. {{Admon/tip|SD Card is Only Used for Booting|If you're using a root filesystem on a USB drive, once the system has booted, you can remove the SD card! You can then use the SD reader to load photos from a camera card, make another SD card for your Raspberry Pi, or backup your SD card to another one.}}