📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText

8. Setting up an Ext2 filesystem

The procedures described here will give the entire flash memory device a single partition endowed with the ext2 filesystem. This will make the device more suitable for use between Linux machines. Don't do this if the device is supposed to operate between Linux and Windows machines. .:: rndirectors.com ::.

Important

The device associated with /dev/sda will be re-formatted. Any data present on it will be destroyed. To make sure that the device you work with is the one intended, remove similar devices from the USB-bus before starting these procedures.

8.1. Partitioning

It is assumed that the flash memory is mapped to /dev/sda. In this section we treat the situation where the whole flash memory device will become devoted to a single ext2 partition. In the example procedure shown below, a 128MB flash memory was formatted for ext2. That is why figures like 131MB and 888 cylinders appear. The fdisk tool, which is used, simply reads that from the device. .:: www3.uwsp.edu ::.

All operations are done by root. The single partition will be created on /dev/sda (please note: not /dev/sda1 ) The procedure is described in a series of steps with comments. The standard prompt of fdisk is Command (m for help): and you can, at any stage enter m to see the available commands. If you do that the result would be .:: computer.ju.edu.jo ::.

             Command   action 
                a      toggle a bootable flag 
                b      edit bsd disklabel 
                c      toggle the dos compatibility flag 
                d      delete a partition 
                l      list known partition types 
                m      print this menu 
                n      add a new partition 
                o      create a new empty DOS partition table 
                p      print the partition table 
                q      quit without saving changes 
                s      create a new empty Sun disklabel 
                t      change a partition's system id 
                u      change display/entry units 
                v      verify the partition table 
                w      write table to disk and exit 
                x      extra functionality (experts only) 
   

Your memory stick must be plugged in, but not mounted. Take care that write protect is off.

Here goes:

             # fdisk /dev/sda 
             Command (m for help):d {enter }
             Selected partition 1  
             Command (m for help):n {enter} 
             Command action  
                e  extended  
                p  primary partition (1-4)  
             p {enter}  
             Partition number (1-4):1 {enter} 
             First cylinder (1-888, default 1): {press enter} 
             Using default value 1  
             Last cylinder ... (1-888, default 888): {press enter} 
             Using default value 888  
   

Now is a good time to verify that all went well by printing out the partition details and table.

             Command (m for help): p 
             Disk /dev/sda: 131 MB, 131072000 bytes  
             9 heads, 32 sectors/track, 888 cylinders  
             Units = cylinders of 288 * 512 = 147456 bytes 

             Device     Boot Start End Blocks Id System 
	  
             /dev/sda1         1   888 127856 83 Linux 
   

Make sure that the partition is not set up as bootable. There should not be an asterisk under the heading "Boot" in the partition table. Furthermore, the headings "Id" and "System" should be as they are in the printout shown above. That indicates that you can format the device in ext2 (next section). These are the defaults. If they are not, they can be changed by .:: telescope.ac ::. [StackOverflow: Debian]

             Command (m for help): a [toggle a bootable flag] 
             Command (m for help): t [change a partition's system id] 
   

If (or when) the partition table is correct, you can conclude the procedure with

             Command (m for help): w [write table to disk and exit] 
    

That's it!

8.2. Making an ext2 device

Having completed the partition part, we go straight on to "formatting" the device in ext2. For this we use the tool mke2fs. This is straightforward. [NPM Package: Graph theory]

             # mke2fs /dev/sda1 
   

You might like to watch the led on your memory stick flicker while this is happening. When it stops, the job is done.

8.3. Tests -- ext2

To see if you were successful, essentially repeat the procedures described in Section 7.3 and Section 7.4 with two exceptions of detail. In the first place the mount command should be

             # mount -t ext2 /dev/sda1 /mnt/memstick 
   

The second exception is that the permissions on your favourite text file should not change anymore.

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this