HowTo mount your hard drive in DSL LiveCDForum: DSL Tips and Tricks Topic: HowTo mount your hard drive in DSL LiveCD started by: doublezz Posted by doublezz on Dec. 16 2005,17:52
UPDATE!!! Thanks to Doobit, AwPhuch and cbagger01 who offered three simpler solutions than mine, my post I see is a long way away from being the best method. (I feel like a real newbie for overlooking the obvious and instead searching for needles in the haystack.) Simply put if you want a graphical solution, use EmelFM > find the /mnt/hda1 folder or what ever other device folder you want to mount, right click and select mount. Simple and easy without any command line commands. or use the mount.app applet in the application dock called 'Slit' on the bottom right of the enhanced desktop, use the arrows to navigate all the mount points and simply mount/unmount by clicking on the mount button with the bolt symbol (green when mounted, black when unmounted) If you are not on the enhanced desktop, simply right click on the desktop > apps > tools > mount.app or alternatively select run command and type:
----------------------------------------------------- Original post ... After initially having problems mounting my hard drive in the DSL LiveCD and finding almost no useful help in the forum or in the DSL Documentation Project, I thought I would post this HOWTO or rather HOWIDUNNIT!!! :-) (PS: Warning! I have not tested this on a WindowsNT or WindowsXP NTFS file system, and I would imagine that DSL LiveCD may not have the tools to do that safely, so beware if you try mounting Windows drives that are not vfat type formated! NTFS is very tricky to work with in Linux!) The DSL LiveCD installer's Knoppix autoconfiguration did a good job of detecting both of my hard drives: one with Windows on it, and one with both Windows partitions and Linux partitions. Unfortunately when I mounted them I kept getting 'permission denied' messages when I tried to access them as the damnsmall user. (NB: Mounting for newbies is the linux term for adding another file system to the already existing single file system that linux creates on startup.) The problem I faced initially was that the default damnsmall user does not have permissions to mount other file systems, and when I initially mounted my hard drives as the root user, the damnsmall user still could not view them since it lacked permission by default to access root-owned files. So having described the problems I faced, let's describe the method that worked for me -- that is how to get the root user to mount my hard disks in such a way that the damnsmall defaul user could both read and write to them! :-) 1) Use either a) Xterm or b) EmelFM file manager if you want a graphic window, or c) just the simple bash shell (e.g ctrl-alt-f1, NB: ctrl-alt-f2 returns you to the xwindows graphical desktop). 2) Next look to see what hard drive partitions were found when the DSL LiveCD was loaded by typing the following command line:
into any of our command line interfaces. You will see a list of all known drive partitions on your computer. This is what mine looked like: proc /proc proc defaults 0 0 pts /dev/pts devpts mode=0622 0 0 /dev/fd0 /mnt/auto/floppy auto user,noauto,exec,umask=000 0 0 /dev/cdrom /mnt/auto/cdrom auto user,noauto,exec,ro 0 0 # Added by KNOPPIX /dev/hdc1 /mnt/hdc1 vfat noauto,users,exec,umask=000,uid=1001,gid=500 0 0 # Added by KNOPPIX /dev/hda1 /mnt/hda1 vfat noauto,users,exec,umask=000,uid=1001,gid=500 0 0 # Added by KNOPPIX /dev/hda5 /mnt/hda5 ext2 noauto,users,exec 0 0 # Added by KNOPPIX /dev/hda6 none swap defaults 0 0 # Added by KNOPPIX /dev/hda7 /mnt/hda7 reiserfs noauto,users,exec 0 0 It found two hard drives: hda and hdc (hda is the first hard drive on my first IDE strip while hdc is the first hard drive on my second IDE strip) In addition it found four hard disk partitions on my hda hard disk: hda1 (windows type vfat), hda5 (linux type ext2) hda6 (linux type swap), and hda7 (linux type reiserfs, a journalled file system). (NB: if you also want to see which devices are currently mounted into your linux filesystem, type at the command line prompt:
(NB: at a minimum DSL LiveCD should have found one hard drive with one partition hda, if there is any hard drive at all in your computer.) 3) To mount a hard drive partition (meaning to merge it with the currently running linux file system), you will have to enter some command lines as the root user to mount your hard drives and to be able for all users to view and use files on that hard drive. (NB: This is not difficult for Newbies, as long as they type carefully and exactly as instructed, including any blank spaces or lack of blank spaces). - that means to become the root user, if you use Xterm or a bash shell you will need to type
- if you are using EmelFM you just type
to view the present working directory as viewed by the root user, probably /ramdisk/home/damnsmall ). 'sudo', I believe, means 'superuser do' which grants root privelages temporarily to another user. 4) HERE IS THE IMPORTANT PART: To mount my 'hda1' windows drive, I typed the following into the Xterm root prompt, as a root user (see above):
The command reads: a) mount the hda1 device to the folder named '/mnt/hda1' (i.e. the hda1 folder, found in the mnt folder, found in the root directory, which is sort of like the c:\ drive in Windows) b) with the '-o' option named umask=000 (NB: that is three zeros not three letter Os) which is the critical option that allows all users access to the files on the hard drive. (NB: Without the umask=000 option all other users except root will get "permission denied" error messages when they try to access the files on the newly mounted hard disk.) If you are using the command line provided in EmelFM, the graphical file system manager on your DSL desktop, then you would type instead in the damnsmall@box textbox the command prefaced with 'sudo':
There it's now done! The hard drive is mounted as readable and writable. Now you just have to view it. 5) VIEWING your hard drive. In Xterm or bash, to list the files, type:
(or whatever folder you mounted it to). Of course this only lists in a command line view the files. If you prefer a graphical file browser like explorer then use the EmelFM which is found as an icon on the enhanced DSL desktop or in the apps > tools menu if you right click on the desktop. Just click on the UpDir(ectory) icon until you reach the root directory that contains a folder named 'mnt' then click on the 'mnt' folder and again on the 'hda1' folder (if that was where you mounted your hard drive) and you will see all your files. You can copy, move, delete, etc. to your heart's content. (Hint: to create an empty file named test.txt type at the command prompt
:-) 6) As some final hints, you might want to create a folder in your damnsmall user's folder as a place to mount your hard drive's files instead of the default locations in the 'mnt' folder that were created on startup (Hint: try the list command
To create a new folder here type (or in EmelFM if that is what you are using):
(or what ever name you want to give it) This will make a directory named 'hda1' in the damnsmall folder. Then to mount your drive here, type:
The './hda1' mount location will default to the newly created directory. To list the files, type:
Another option that you might want to add to your mount command if you are afraid of doing some damage to your files on your window drive is the 'ro' option which means 'read only' By default the drives are mounted 'rw' meaning read write. You might accidently modify them if they are 'writable'. To only view and read the files, for security purposes, use the 'ro' option instead by typing:
Have fun! Doublezz Sorry about the long post but I want to be helpful to newbies too. Posted by AwPhuch on Dec. 16 2005,18:41
Awesome post man!However the mount tab on the fluxbox slit on the right of the window does it for you.... Hit the little arror...until you see the dev you want to mount..hit the little key Done P.S. Shell method is much more cooler though heh Brian AwPhuch Posted by doobit on Dec. 16 2005,21:19
Thanks for the post! I have had no trouble mounting hard drives with a sudo su /mnt/hda1 command, but unmounting them can be a problem. In jwm, you don't have slit, but Emelfm mounts and unmounts just fine, most of the time.NTFS can not be written to by DSL, though it can see the file names. DSL has no problem with FAT and in fact, my Windows partitions have become little more than extra storage space these days. Posted by cbagger01 on Dec. 17 2005,05:48
You can safely mount NTFS partitions.They will be mounted as "read only" and you can get or view files on them with no problems. However, you will not be able to save or modify files on the NTFS partitions. Because they are mounted as "read-only" permission, you do not need to worry about breaking anything while you are mounted to these partitions. Posted by cbagger01 on Dec. 17 2005,05:50
Oh yeah,You should be able to mount partitions as user DSL as long as you do not specify the full mount command and the mounting information is listed inside the /etc/fstab file. In other words: mount /mnt/hda1 will work just fine, while mount -t vfat /dev/hda1 /mnt/hda1 will choke unless you are user "root" or some other user that has the permission to do this. Posted by doublezz on Dec. 17 2005,13:10
Muchos Gracios!!! Amigos - Your added comments were really helpful! Thanks for pointing out the obvious when I spent my time looking for a needle in a haystack.AwPhuch - thanks for showing me how to use mount.app in the application dock called 'Slit' on the enhanced desktop. ... it worked perfectly and had I ever found that I would never have busted by backside trying to find the command line equivalent, even though I learned something in the process. I really think that this simple solution should be explained somewhere obvious for NEWBIES to DSL like me. I couldn'f find it anywhere obvious on the www.damnsmalllinux.org website. Doobit - thank for mentioneing the EmelFM solution, just mount the HD in EmelFM as Damnsmall user by simply right clicking on the /mnt/hda1 link and selecting mount. Oh, and you're right, I finally tested it on a WinXP box and sure enough it mounts NTFS as read only. Thanks. cbagger01 - excellent! I wish I had known the simple mount /mnt/hda1 command for non-root users. It works great and is much simpler than the complicated command line I found to work. Kudos Again though, why isn't this documented anywhere for Newbies? Thanks again. Doublezz Posted by mohoj on Jan. 02 2006,14:59
Hello doublezz !Thank You for your lesson on mounting -- After that it appeared, I was able to gain access to my hda3. Unfortunately I was not able to se "where" it was mounted, but I was able to store a file from the word-processor and also from MMx, however it all disappeared upon rebooting ! How may I store my mounting ? Also my configuring in Sylpheed disappeared. My system claims "too many mount points" and suggests use of "C2Fscs" . What is that ? How do I work in etc/fstab ? Your comments are appreciated, or just ref. to some further reading. Greetings, mohoj PS.: I boot from a memo-stick, and I do not use hda1 and hda2 yet. |