Linux block device driver (v)--operation of block device application layer

Source: Internet
Author: User

One: Load good sbull drive

[Email protected]:/# ls/dev/sbull-l brw-r--r--1 root root 254, Mar 08:25/dev/sbull [email protected]:/#

You can see that the Sbull file property is a block device, the main device number is 254, the secondary device number is 16

Second: Partition the device

[Email protected]:/# fdisk/dev/sbull [266.720648] sbull:unknown partition table Welcome to fdisk (Util-linux 2.24.1). Changes'll remaininchMemory only, until the decide to write them. Be careful beforeusingThe Write command. Device does not contain a recognized partition table. Created ANewDOS disklabel with disk identifier 0xb90ed7e4. Command (M forHelp): M Help:dos (MBR) A toggle a bootable flag B edit nested BSD disklabel C toggle the DOS compatibility flag Generic D Delete a partition L list known partition types n Add aNewPartition P print the partition table T change a partition type V verify the partition table Misc m print ThisMenu U change display/entry units x extra functionality (experts only) Save & exit W Write table to disk and exit Q qu It without saving changes Create aNewLabel G Create aNewEmpty GPT partition Table G Create aNewEmpty SGI (IRIX) partition table O Create aNewEmpty DOS partition Table s Create aNewEmpty Sun partition Table Command (M forHelp): N//Enter N to add a new partitionPartition Type:p Primary (0 primary, 0 extended, 4 free) e extended Select (default p): P//Primary partition Partition Nu Mber (1-4, default 1): 1//This partition is the first sector (1-1023, default 1): 1///The partition starting sector last sector, +sectors or +size{k,m,g,t,p} (1-1023, default 1023): 1023//end sector of the partition Created a new partition 1 of type ' Linux ' and of size 511.5 KiB. Command (M for help): w//Save and exit the partition table has been altered. Calling IOCTL () to re-read parti[303.589984] sbull:sbull1 tion table. Syncing disks.

View partitions: The author made two partitions

[Email protected]:/# ls/dev/sbull*
/dev/sbull/dev/sbull1/dev/sbull2
[email protected]:/ #

Two: Format file system

[email protected]:/# mkfs.ext4/dev/sbull2mke2fs 1.42.4 (12-June-2012) Filesystem label=os type:linuxblock size=1024 (log=0) Fragment size=1024 (log=0) stride=0 blocks, Stripe width=0 blocks64 i Nodes, 504 BLOCKS25 blocks (4.96%) reserved for the Super Userfirst data block=1maximum Filesyst EM blocks=5242881 block group8192 blocks per group, 8192 fragments per group64 inodes per groupallocating group Tables:do Ne Writing inode tables:done Filesystem too small for a journalwriting superblocks and Filesyst EM accounting Information:done

Three: Hanging on file system

[email protected]:/# mount/dev/sbull1/tmp/mnt/sbull/mount:mounting/dev/sbull1 on/tmp/mnt/sbull/failed:invalid argument [email protected]:/# mount/dev/sbull2/tmp/mnt/sbull/[832.527053] Ext4-fs (sbull2): couldn' t mou NT as ext3 due to feature incompatibilities [832.557133] Ext4-fs (sbull2): couldn 'T mount as ext2 due to FE Ature incompatibilities [832.588127] Ext4-fs (SBULL2): Mounted filesystem without journal. Opts: (null) [email protected]:/# [Email protected]:/#

The above completed the application layer of the block device hanging in operation, the next can be directly in the/tmp/mnt/sbull directory to operate the

Linux block device driver (v)--operation of block device application layer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.