How to access paritions to store data?
Hi. I have just installed Feisty Fawn in my newly upgraded PC. I partitioned the HD into 2 so that I can store data in the other partition and learn how to make partitions manually. Here are the partitions when I type fdisk:
Device Boot Start End Blocks Id System /dev/sda1 1 6687 53713296 83 Linux /dev/sda2 6688 9729 24434865 5 Extended /dev/sda5 6688 9483 22458838+ 83 Linux /dev/sda6 9484 9729 1975963+ 82 Linux swap / Solaris I really am not familiar with the file system of Linux but when I made the partitions the "/" is the root is in ext 3 format and I allocated 50+ GBs. I also made a swap partition and the other one that is making me confused is the format ext2 and I can see this at the file system but the problem is I can not access it because when I click properties/permission it says that I am not the owner and I can not access this folder. Now, how do I gain access and use this partition? Should I login as the root and change the permissions? How do I do this? If I am going to use the terminal, what are the commands? Thanks and have a nice day to all of you out there. Peace. |
is it mounted?
|
To start with, get familiar with a command or two.
Open a terminal and type: Code:
man df Type "q" to exit the manual. Now type: Code:
df Now try: Code:
man fstab Now try: Code:
sudo gedit /etc/fstab Gedit should start and you are now editing your filesystem table (which filesystems exist and which will mount at boot time). For now, do NOT edit you fstab, you could cause major problems if your / partition can't mount at boot! But don't worry too much, everything is fixable. You need to mount your spare partition with your normal user priveleges yes? Read the ouptut of "df" and post it here please and I will help you to modify your fstab correctly. |
to access any partition you should mount it in you filesystem "/" usually under /media in ubuntu or /mnt in other linux systems but it can be mounted almost anywhere like /home/account/sharedfiles
first create a directory where your going to mount it Code:
mkdir /media/newDirectoryName Code:
mount /dev/sdaN /media/newDirectoryName to change permisions Code:
chmod ugoa+rwx -r /directory Code:
chmod --help |
Hi. Thanks for the quick replies. Here is my df output:
mapmaker@mapmaker-desktop:~$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 52870076 2810208 47374204 6% / varrun 517736 100 517636 1% /var/run varlock 517736 0 517736 0% /var/lock procbususb 517736 84 517652 1% /proc/bus/usb udev 517736 84 517652 1% /dev devshm 517736 0 517736 0% /dev/shm lrm 517736 33788 483948 7% /lib/modules/2.6.20-16-generic/volatile /dev/sda5 22105760 52 20982768 1% /garage the /dev/sda5 is the other partition I made when I installed Ubuntu and its partition name is /garage. Does it mean that it is mounted but there are no necessary permissions that will enable me to access and store files here right? Thanks a lot for all the help I really want to learn Ubuntu so that I will stay away from XP. :) |
I made a directory for the partition where I will mount it and here is what I typed in terminal:
mkdir /home/mapmaker/Hangar A Hangar directory was created in my mapmaker account Then, I typed the following commands: mapmaker@mapmaker-desktop:~$ sudo su root@mapmaker-desktop:/home/mapmaker# mount /dev/sda1 on / type ext3 (rw,errors=remount-ro) proc on /proc type proc (rw,noexec,nosuid,nodev) /sys on /sys type sysfs (rw,noexec,nosuid,nodev) varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755) varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) devshm on /dev/shm type tmpfs (rw) devpts on /dev/pts type devpts (rw,gid=5,mode=620) lrm on /lib/modules/2.6.20-16-generic/volatile type tmpfs (rw) /dev/sda5 on /garage type ext2 (rw) binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) root@mapmaker-desktop:/home/mapmaker# sudo mount /dev/sda5 home/mapmaker/Hangarmount: mount point home/mapmaker/Hangar does not exist However, the /dev/sda5 was not mounted on Hangar. What should I correctly do to mount the /garage to Hangar? Thanks. |
no need for the "sudo" command, you were already root!
You should NOT be root to do the following: un-mount /garage: Code:
sudo umount /garage Code:
sudo mount -o uid=1000 /dev/sda5 /home/mapmaker/Hangar the above will work if you are uid 1000, to check, do this: Code:
less /etc/passwd Look for your username, the number "1000" should appear in the 3rd and 4th fields on that line. hit "q" to exit the "less" command. see "man mount" |
I tried to mount and these are what I did in the Terminal:
mapmaker@mapmaker-desktop:~$ sudo umount /garage Password: mapmaker@mapmaker-desktop:~$ sudo mount -o uid=1000 /dev/sda5 /home/mapmaker/Hangar mount: wrong fs type, bad option, bad superblock on /dev/sda5, missing codepage or other error In some cases useful info is found in syslog - try dmesg | tail or so mapmaker@mapmaker-desktop:~$ This is the information about less etc/passwd: root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/bin/sh bin:x:2:2:bin:/bin:/bin/sh sys:x:3:3:sys:/dev:/bin/sh sync:x:4:65534:sync:/bin:/bin/sync games:x:5:60:games:/usr/games:/bin/sh man:x:6:12:man:/var/cache/man:/bin/sh lp:x:7:7:lp:/var/spool/lpd:/bin/sh mail:x:8:8:mail:/var/mail:/bin/sh news:x:9:9:news:/var/spool/news:/bin/sh uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh proxy:x:13:13:proxy:/bin:/bin/sh www-data:x:33:33:www-data:/var/www:/bin/sh backup:x:34:34:backup:/var/backups:/bin/sh list:x:38:38:Mailing List Manager:/var/list:/bin/sh irc:x:39:39:ircd:/var/run/ircd:/bin/sh gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh nobody:x:65534:65534:nobody:/nonexistent:/bin/sh dhcp:x:100:101::/nonexistent:/bin/false syslog:x:101:102::/home/syslog:/bin/false klog:x:102:103::/home/klog:/bin/false messagebus:x:103:106::/var/run/dbus:/bin/false avahi-autoipd:x:104:110:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/bin/false : |
Quote:
Code:
sudo mount -o uid=1000,rw -t ext2 /dev/sda5 /home/mapmaker/Hangar I added the "-t ext2" option so that it mounts it as a ext2 filesystem. Did you try the suggested command? This one: Code:
dmesg | tail "| tail" pipes the output through the program "tail", this has the effect of only showing the last few lines (10 by default) of the system messages. "dmesg" is very useful in determining system problems such as mount errors. Quote:
And remember, if unsure, rtfm! Use the manual pages a lot! "man [command name]". Also try "info [command name]". |
I tried the dmesg | tail after mounting the partition and here is what appeared:
Quote:
Quote:
Quote:
|
I tried the dmesg | tail command and it says:
Quote:
|
Quote:
|
Quote:
did you notice this line? Quote:
Now edit your /etc/fstab, add this line to the end of your /etc/fstab: Code:
/dev/sda5 /home/mapmaker/Hangar ext2 uid=1000,gid=1000,rw 0 1 Code:
umount /dev/sda5 Code:
sudo chown 1000:1000 /home/mapmaker/Hangar Code:
mount /dev/sda5 |
You are using ubuntu, you could just use the pmount command.
pmount /dev/sdax |
I added the line in the fstab using sudo gedit /etc/fstab and added the line to the last.
I also mounted the drive and this appeared in Terminal: Quote:
Quote:
|
All times are GMT -5. The time now is 06:00 PM. |