Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3003919
  • 博文数量: 674
  • 博客积分: 17881
  • 博客等级: 上将
  • 技术积分: 4849
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-17 10:15
文章分类

全部博文(674)

文章存档

2013年(34)

2012年(146)

2011年(197)

2010年(297)

分类: LINUX

2010-08-21 19:54:19

LinuxBootDiskFormat
How to create a dual-partition card for BeagleBoard to boot Linux from first partition and have root file system at second partition.

Determine which device the SD Card Reader is on your system

Plug the SD Card into the SD Card Reader and then plug the SD Card Reader into your system. After doing that, do the following to determine which device it is on your system.

$ [dmesg | tail]
...
[ 6854.215650] sd 7:0:0:0: [sdc] Mode Sense: 0b 00 00 08
[ 6854.215653] sd 7:0:0:0: [sdc] Assuming drive cache: write through
[ 6854.215659]  sdc: sdc1
[ 6854.218079] sd 7:0:0:0: [sdc] Attached SCSI removable disk
[ 6854.218135] sd 7:0:0:0: Attached scsi generic sg2 type 0
...

In this case, it shows up as /dev/sdc (note sdc inside the square brackets above).

$ [df -h]
Filesystem            Size  Used Avail Use% Mounted on
...
/dev/sdc1             400M   94M  307M  24% /media/disk
...


Be sure to choose the whole device (/dev/sdc), not a single partition (/dev/sdc1).

$ [sudo fdisk /dev/sdc]

Command (m for help): [p]

Disk /dev/sdc: 2021 MB, 2021654528 bytes
255 heads, 63 sectors/track, 245 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   
Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1         246     1974240+   c  W95 FAT32 (LBA)
Partition 1 has different physical/logical endings:
     phys
=(244, 254, 63) logical=(245, 200, 19)






Expert Command (m for help): [c]
Number of cylinders (1-256, default xxx): [enter the number you calculated]

Command (m for help): [p]

Disk /dev/sdc: 2021 MB, 2021654528 bytes
255 heads, 63 sectors/track, 245 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   
Device Boot      Start         End      Blocks   Id  System




Command (m for help): [p]

Disk /dev/sdc: 2021 MB, 2021654528 bytes
255 heads, 63 sectors/track, 245 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   
Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *           1          51      409626    c  W95 FAT32 (LBA)
/dev/sdc2              52         245     1558305   83  Linux


$ [sudo mkfs.msdos -F 32 /dev/sdc1 -n LABEL1]
mkfs
.msdos 2.11 (12 Mar 2005)

$
[sudo mkfs.ext3 -L LABEL2 /dev/sdc2]
mke2fs
1.40-WIP (14-Nov-2006)
Filesystem label=
OS type
: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
195072 inodes, 389576 blocks
19478 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=402653184
12 block groups
32768 blocks per group, 32768 fragments per group
16256 inodes per group
Superblock backups stored on blocks:
       
32768, 98304, 163840, 229376, 294912

Writing inode tables: done                            
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information:

console=ttyS2,115200n8 root=/dev/mmcblk0p2 rw rootdelay=1
阅读(1098) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~