Hardware
Xtreamer mit interner HD (sda) und schnellem Transcend 4GB USB Stick (sdb)
Den USB Stick möchte ich wie folgt verwenden:
/dev/sdb1 ext3
/dev/sdb2 swap
Die Reihenfolge der Partitionen ist wichtig, da der Xtreamer die swap Partition an erster Stelle nicht ordnungsgemäß einbinden würde !
An Erster Stelle muss sich die Datenpartition befinden.
Die ext3 Partition möchte ich zum Testen verwenden, da das root Filesystem nur 48MB frei hat.
Die SWAP Partition soll einem Speicherüberlauf (Bug) beim Nutzen der Onlineinhalte vorbeugen.
Der Aktuelle Stand
USB Stick ist eingesteckt, aktuell mit einer NTFS Partition:
# cat /proc/partitions major minor #blocks name 31 0 24704 mtdblock0 31 1 208000 mtdblock1 31 2 16384 mtdblock2 31 3 13056 mtdblock3 31 4 262144 disc 8 0 195360984 sda 8 1 194868450 sda1 8 2 160650 sda2 8 16 4005888 sdb 8 17 4005855 sdb1
Partitionen erstellen
bash-3.2# fdisk /dev/sdb Command (m for help): o Building a new DOS disklabel. Changes will remain in memory only, until you decide to write them. After that, of course, the previous content won't be recoverable. Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 1 First cylinder (1-498, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-498, default 498): 3400M Value out of range. Last cylinder or +size or +sizeM or +sizeK (1-498, default 498): +3400M Command (m for help): n Command action e extended p primary partition (1-4) p Partition number (1-4): 2 First cylinder (415-498, default 415): Using default value 415 Last cylinder or +size or +sizeM or +sizeK (415-498, default 498): Using default value 498 Command (m for help): t Partition number (1-4): 1 Hex code (type L to list codes): L 0 Empty 12 Compaq diagnost 81 Minix / old Lin a8 Darwin UFS 1 FAT12 14 Hidden FAT16 <3 82 Linux swap a9 NetBSD 4 FAT16 <32M 16 Hidden FAT16 83 Linux ab Darwin boot 5 Extended 17 Hidden HPFS/NTF 84 OS/2 hidden C: b7 BSDI fs 6 FAT16 1b Hidden Win95 FA 85 Linux extended b8 BSDI swap 7 HPFS/NTFS 1c Hidden Win95 FA 86 NTFS volume set be Solaris boot a OS/2 Boot Manag 1e Hidden Win95 FA 87 NTFS volume set eb BeOS fs b Win95 FAT32 3c PartitionMagic 8e Linux LVM ee EFI GPT c Win95 FAT32 (LB 41 PPC PReP Boot 9f BSD/OS ef EFI (FAT-12/16/ e Win95 FAT16 (LB 42 SFS a0 IBM Thinkpad hi f0 Linux/PA-RISC b f Win95 Ext'd (LB 63 GNU HURD or Sys a5 FreeBSD f2 DOS secondary 11 Hidden FAT12 80 Old Minix a6 OpenBSD fd Linux raid auto Hex code (type L to list codes): 83 Command (m for help): t Partition number (1-4): 2 Hex code (type L to list codes): 82 Changed system type of partition 2 to 82 (Linux swap) Command (m for help): w The partition table has been altered! Calling ioctl() to re-read partition table. WARNING: Re-reading the partition table failed with error 16: Device or resource busy. The kernel still uses the old table. The new table will be used at the next reboot. Syncing disks. bash-3.2# reboot bash-3.2# cat /proc/partitions major minor #blocks name 31 0 24704 mtdblock0 31 1 208000 mtdblock1 31 2 16384 mtdblock2 31 3 13056 mtdblock3 31 4 262144 disc 8 0 195360984 sda 8 1 194868450 sda1 8 2 160650 sda2 8 16 4005888 sdb 8 17 3325423 sdb1 8 18 674730 sdb2
Partitionen formatieren
Die Partition 1 hat der xtreamer nach dem reboot einfach als vfat eingebunden, obwohl die Partition garnicht formatiert ist (wtf? war der Stick vorher vieleicht doch mit FAT statt NTFS formatiert) und muss daher vor dem Formatieren unmount’ed werden:
bash-3.2# mount /dev/root on / type yaffs2 (rw,noatime) none on /dev type devfs (rw) none on /proc type proc (rw,nodiratime) devpts on /dev/pts type devpts (rw) none on /sys type sysfs (rw) none on /tmp type ramfs (rw) /dev/mtdblock/2 on /usr/local/etc type yaffs2 (rw,noatime) /dev/scsi/host0/bus0/target0/lun0/part1 on /tmp/usbmounts/sda1 type ufsd (rw,nodiratime) /dev/rd/0 on /mnt/rd type vfat (rw,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1) /dev/scsi/host2/bus0/target0/lun0/part1 on /tmp/usbmounts/sdb1 type vfat (rw,nodiratime,fmask=0000,dmask=0000,codepage=cp437,iocharset=iso8859-1,shortname=winnt,utf8) bash-3.2# umount /tmp/usbmounts/sdb1 bash-3.2# mkfs.ext3 /dev/sdb1 mke2fs 1.38 (30-Jun-2005) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 416000 inodes, 831355 blocks 41567 blocks (5.00%) reserved for the super user First data block=0 26 block groups 32768 blocks per group, 32768 fragments per group 16000 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200 Writing inode tables: done Creating journal (16384 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 32 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. bash-3.2# mkswap /dev/sdb2 mkswap: warning: truncating swap area to 524284kB Setting up swapspace version 1, size = 536862720 bytes bash-3.2# reboot
Überprüfen
Nach dem reboot bindet der xtreamer die Partitionen ordnungsgemäß ein:
bash-3.2# cat /proc/swaps Filename Type Size Used Priority /dev/scsi/host0/bus0/target0/lun0/part2 partition 160640 260 -1 /mnt/rd/swap.img file 32 0 -2 /dev/scsi/host2/bus0/target0/lun0/part2 partition 524276 0 -3 bash-3.2# mount /dev/root on / type yaffs2 (rw,noatime) none on /dev type devfs (rw) none on /proc type proc (rw,nodiratime) devpts on /dev/pts type devpts (rw) none on /sys type sysfs (rw) none on /tmp type ramfs (rw) /dev/mtdblock/2 on /usr/local/etc type yaffs2 (rw,noatime) /dev/scsi/host0/bus0/target0/lun0/part1 on /tmp/usbmounts/sda1 type ufsd (rw,nodiratime) /dev/rd/0 on /mnt/rd type vfat (rw,nodiratime,fmask=0022,dmask=0022,codepage=cp437,iocharset=iso8859-1) /dev/scsi/host2/bus0/target0/lun0/part1 on /tmp/usbmounts/sdb1 type ext3 (rw)