{"id":6,"date":"2007-06-29T00:02:29","date_gmt":"2007-06-29T04:02:29","guid":{"rendered":"http:\/\/www.microworkshop.com\/WordPress\/?p=6"},"modified":"2012-10-09T23:41:15","modified_gmt":"2012-10-10T04:41:15","slug":"windows-linux-mutually-accessing-various-filesystems-on-the-same-pc","status":"publish","type":"post","link":"https:\/\/microdevsys.com\/wp\/windows-linux-mutually-accessing-various-filesystems-on-the-same-pc\/","title":{"rendered":"Windows \/ Linux: Mutually accessing various filesystems on the same PC."},"content":{"rendered":"<p>Especially true with dual boot systems, sharing files between two different operating systems on a single PC can become a time consuming task.&nbsp; One thing many new users do when they install a Linux on a different partition of the same machine, is to try to connect to the other operating systems and files they have on the native OS.&nbsp; At least do so without actually having to boot into windows OR linux again or having to resort to other combersome means of getting copies of your files between the two operating systems.&nbsp; Fortunately latest versions of Linux come with an entire zoo of functions to do this with.&nbsp; And the best part is, it&#39;s not that difficult at all:<\/p>\n<p><!--more--><\/p>\n<p><span style=\"font-size: medium;\"><u><strong>LINUX<\/strong><\/u><\/span><\/p>\n<p>Linux makes this easy.&nbsp; There, the best way to get access to those files is to have them mounted on your linux filesystem so all you&#39;ll need to do is to run something like:<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ cd \/mnt\/c<\/strong><\/p>\n<p>OR<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ cd \/mnt\/d<\/strong><\/p>\n<p>to access those Window (Or any other operating system) partitions and read \/ write or even execute from the newly connected windows partition. The command we&#39;ll use for this is the <strong>mount<\/strong> command and also the default built in Linux automounter daemon which runs when your box boots. To make mounting \/ unmounting simpler and have automounter handle this for you when you boot your box, the first thing you&#39;ll probably want to do is to define the partitions in <strong><em>\/etc\/fstab<\/em><\/strong> (This is the text config file the automounter and <strong>mount<\/strong> uses when you try to mount a drive without specifically telling mount what type of FS (filesystem) you&#39;re actually trying to mount. Let&#39;s suppose you have three windows partitions such as <strong><em>C:\\&gt;<\/em><\/strong> , <strong><em>D:\\&gt;<\/em><\/strong> and <strong><em>E:\\&gt;<\/em><\/strong>. Here&#39;s what your <strong><em>\/etc\/fstab<\/em><\/strong> might look like in this case:<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ cat \/etc\/fstab|grep vfat<\/strong><\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hda1 \/mnt\/c vfat defaults 0 0<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hda5 \/mnt\/d vfat defaults 0 0<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hda6 \/mnt\/e vfat defaults 0 0 <strong>$<\/strong> First column is the device. Unix devices reside in <strong><em>\/dev<\/em><\/strong>. Here&#39;s what the letters in <strong><em>hda1<\/em><\/strong> mean: <strong>hd<\/strong> &#8211; <strong>H<\/strong>ard <strong>D<\/strong>rive. This is your standard disk drive that comes with PC&#39;s. Typically <strong>h<\/strong> stands for IDE interface in systems. <strong>a<\/strong> &#8211; The physical disk. If you have more then one hard disk installed on your pc, the first will be <strong>a<\/strong>, the second <strong>b<\/strong>, the third <strong>c<\/strong> etc. On my system this is <strong>a<\/strong>. <strong>1<\/strong> &#8211; The partition on the physical disk. In my case I have three. C:\\&gt; = <strong>1<\/strong>, D:\\&gt; = <strong>5<\/strong> and E:\\&gt; = <strong>6<\/strong> hence:<\/p>\n<p style=\"padding-left: 30px;\"><strong>\/dev\/hda1 C:\\&gt; <\/strong><\/p>\n<p style=\"padding-left: 30px;\"><strong>\/dev\/hda5 D:\\&gt; <\/strong><\/p>\n<p style=\"padding-left: 30px;\"><strong>\/dev\/hda6 E:\\&gt;<\/strong><\/p>\n<p>On latest systems such as Fedora 9 you will see a slight change:<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ cat \/etc\/fstab|grep vfat<\/strong><\/p>\n<p style=\"padding-left: 30px;\">\/dev\/sda1 \/mnt\/c vfat defaults 0 0<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/sda5 \/mnt\/d vfat defaults 0 0<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/sda6 \/mnt\/e vfat defaults 0 0 <strong>$<\/strong> In this case <strong>s<\/strong> stands for Serial Device which may be <strong>SATA \/<\/strong> <strong>IDE<\/strong> or <strong>SCSI<\/strong> interface and newer Unix \/ Linux configurations use <strong>sda<\/strong>. Great. But how do you know on your system which are yours. You&#39;ll need to run<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ fdisk -l <\/strong><\/p>\n<p>(<span style=\"color: rgb(0, 0, 255);\"><strong>NOTE<\/strong><\/span>: More on <strong>fdisk<\/strong> later. For the moment we need it just to get some information on what partitions exist on our system.)<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ fdisk -l<\/strong><\/p>\n<p>will list hard disk information and their partitions similar to this:<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ <\/strong><strong>fdisk -l<\/strong> Disk \/dev\/hda: 40.0 GB, 40020664320 bytes 255 heads, 63 sectors\/track, 4865 cylinders<\/p>\n<p style=\"padding-left: 30px;\"><strong>Units = cylinders of 16065 * 512 = 8225280 bytes<\/strong><\/p>\n<p style=\"padding-left: 30px;\">Device Boot Start End Blocks Id System<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hda1 * 1 1217 9775521 c W95 FAT32 (LBA)<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hda2 1218 4865 29302560 f W95 Ext&#39;d (LBA)<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hda5 1218 2421 9671098+ b W95 FAT32<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hda6 2422 4865 19631398+ b W95 FAT32<\/p>\n<p style=\"padding-left: 30px;\">Disk \/dev\/hdb: 120.0 GB, 120034123776 bytes 255 heads, 63 sectors\/track, 14593 cylinders<\/p>\n<p style=\"padding-left: 30px;\">Units = cylinders of 16065 * 512 = 8225280 bytes<\/p>\n<p style=\"padding-left: 30px;\">Device Boot Start End Blocks Id System<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hdb1 * 1 255 2048256 83 Linux<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hdb2 256 4079 30716280 83 Linux<\/p>\n<p style=\"padding-left: 30px;\">\/dev\/hdb3 4080 10453 51199155 83 Linux . . . . . Notice the information on <strong>\/dev\/hda<\/strong>. It tells you amongst other things, partition type, size, start and end cylinder etc. In our case we just need to know where our windows partitions are. Your values may differ. Once you&#39;ve edited your <strong>\/etc\/fstab<\/strong> config file (<span style=\"color: rgb(0, 0, 255);\"><strong>NOTE<\/strong><\/span>: Some Linux editors available to you: <strong>vi<\/strong>, <strong>pico<\/strong>, <strong>nano<\/strong>. Type <strong>which &lt;COMMAND&gt;<\/strong> to find the paths they are located in. For GUI based editors, a couple of good ones are <strong>kate<\/strong>, <strong>kedit<\/strong> and <strong>kwrite<\/strong>. ) and saved it, it&#39;s time to create the mount points you defined above. In my case I&#39;ll use <strong><em>\/mnt\/c<\/em><\/strong> for <em><strong>C:\\&gt;<\/strong><\/em> etc. You can use any path you want. Traditionally the paths for mounting have been <strong>\/mnt<\/strong> and more recently with new distributions <strong><em>\/media<\/em><\/strong> but you can use any paths you want. Time to mount your partitions. All we need to do now is to issue the following command:<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ mount \/mnt\/c<\/strong><\/p>\n<p><strong>mount<\/strong> will now look into your <strong><em>\/etc\/fstab<\/em><\/strong> to see how it should mount based on the parameter you passed to it. In fact you could also type:<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ mount \/dev\/hda1<\/strong><\/p>\n<p>and it would know what you&#39;re talking about since the entry has been devined in <em><strong>\/etc\/fstab<\/strong><\/em>. Without defining entries in <em><strong>\/mnt\/fstab<\/strong><\/em> your command line would be something like this:<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ mount -t vfat \/dev\/hda1 \/mnt\/c<\/strong><\/p>\n<p>which would also do the trick but you would loose the benefit of having the partition automounted at boot time and reducing extra parameter when mounting \/ unmounting. To unmount a partition type:<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ umount \/mnt\/c<\/strong><\/p>\n<p>to unmount the <strong><em>\/mnt\/c<\/em><\/strong> partition. Once you mount your windows partitions, all you need now is to go into the folder <strong>\/mnt\/c<\/strong> as you would into any other directory and browse, copy and edit files on it (provided you have &#39;w&#39;rite access as well). Because you have the path defined in <strong><em>\/etc\/fstab<\/em><\/strong> the built in Linux automounter should also be able to mount these drives for you automatically on your next boot into your Linux installation. A cool feature of the mount utility is that mounting floppy disks and cdrom&#39;s is done in a similar manner. In fact, you can also do the same for <em><strong>ISO<\/strong><\/em> images in this manner:<\/p>\n<p style=\"padding-left: 30px;\"><strong>$ mount -o loop \/PATH\/my_cd_image.iso \/mnt\/iso<\/strong><\/p>\n<p>Here&#39;s how your <strong><em>\/etc\/fstab<\/em><\/strong> might appear different if you also include your floppy disk and <em><strong>CD-ROM<\/strong><\/em>:<\/p>\n<p style=\"padding-left: 30px;\"><strong><em>\/dev\/cdrom \/mnt\/cdrom auto noauto,unhide 0 0 # CD-ROM DRIVE<\/em><\/strong><\/p>\n<p style=\"padding-left: 30px;\"><strong><em>\/dev\/fd0 \/mnt\/floppy auto noauto 0 0 # Floppy disk.<\/em><\/strong><\/p>\n<p>In the case of the floppy disk, you&#39;ll need to mount\/unmount as you swap floppies in the drive.<\/p>\n<p><span style=\"font-size: medium;\"><strong><u>WINDOWS<\/u><\/strong><\/span><\/p>\n<p>Upcoming!<\/p>\n\n    <div class=\"xs_social_share_widget xs_share_url after_content \t\tmain_content  wslu-style-1 wslu-share-box-shaped wslu-fill-colored wslu-none wslu-share-horizontal wslu-theme-font-no wslu-main_content\">\n\n\t\t\n        <ul>\n\t\t\t        <\/ul>\n    <\/div> \n","protected":false},"excerpt":{"rendered":"<p>Especially true with dual boot systems, sharing files between two different operating systems on a single PC can become a time consuming task.&nbsp; One thing many new users do when they install a Linux on a different partition of the same machine, is to try to connect to the other operating systems and files they [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[3],"tags":[312,776,768,771,775,47,774,772,1550,773,765,25,706,767,287,769,27,136,766,585,1549,770],"class_list":["post-6","post","type-post","status-publish","format-standard","hentry","category-unix-linux-admin-stuff","tag-access","tag-cd-rom","tag-connecting","tag-copy","tag-drive","tag-format","tag-hdd","tag-iso","tag-linux","tag-loop","tag-mnt","tag-mount","tag-partition","tag-pc","tag-problem","tag-read","tag-share","tag-solution","tag-vfat","tag-view","tag-windows","tag-write"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/6","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":0,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"wp:attachment":[{"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microdevsys.com\/wp\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}