LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to access paritions to store data? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-access-paritions-to-store-data-564232/)

jlconferido 06-24-2007 08:14 PM

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.

AceofSpades19 06-24-2007 08:25 PM

is it mounted?

Tuttle 06-24-2007 08:39 PM

To start with, get familiar with a command or two.
Open a terminal and type:
Code:

man df
This is tha manual for the command "df"
Type "q" to exit the manual.
Now type:
Code:

df
You should now see your "mounted" filesystems.
Now try:
Code:

man fstab
again, "q" to exit the manual.
Now try:
Code:

sudo gedit /etc/fstab
Note: you can use the TAB key to autocomplete stuff in a terminal.
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.

offbyte 06-24-2007 08:42 PM

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
then mount the partition there
Code:

mount /dev/sdaN /media/newDirectoryName
if your mounting /dev/sda2 you directory name should be sda2 so you remember

to change permisions
Code:

chmod ugoa+rwx -r /directory
for more details check
Code:

chmod --help
man chmod


jlconferido 06-24-2007 09:36 PM

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. :)

jlconferido 06-24-2007 10:50 PM

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.

Tuttle 06-24-2007 11:38 PM

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
now mount it:
Code:

sudo mount -o uid=1000 /dev/sda5 /home/mapmaker/Hangar
You missed off the "/" for /home/mapmaker/Hangar!!

the above will work if you are uid 1000, to check, do this:
Code:

less /etc/passwd
This is the global user identity file
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"

jlconferido 06-25-2007 12:43 AM

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
:

Tuttle 06-25-2007 05:45 AM

Quote:

Originally Posted by jlconferido
I tried to mount and these are what I did in the Terminal:

mapmaker@mapmaker-desktop:~$ sudo umount /garage
Password:
mapmaker@mapmaker-desktop:~$
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:~$

Okay, we need to tell it to use ext2:
Code:

sudo mount -o uid=1000,rw -t ext2 /dev/sda5 /home/mapmaker/Hangar
I added the "rw" option to make sure it mounts "read/write" (not read only)
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
"dmesg" prints the system message log on screen
"| 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:

Originally Posted by jlconferido
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
:

Ah! do the "less" command again, this time use the down-arrow key to scroll down further and you should see your username.

And remember, if unsure, rtfm! Use the manual pages a lot! "man [command name]". Also try "info [command name]".

jlconferido 06-25-2007 09:59 AM

I tried the dmesg | tail after mounting the partition and here is what appeared:

Quote:

mapmaker@mapmaker-desktop:~$ dmesg | tail
[ 32.424000] Bluetooth: Core ver 2.11
[ 32.424000] NET: Registered protocol family 31
[ 32.424000] Bluetooth: HCI device and connection manager initialized
[ 32.424000] Bluetooth: HCI socket layer initialized
[ 32.576000] Bluetooth: L2CAP ver 2.8
[ 32.576000] Bluetooth: L2CAP socket layer initialized
[ 32.580000] Bluetooth: RFCOMM socket layer initialized
[ 32.580000] Bluetooth: RFCOMM TTY layer initialized
[ 32.580000] Bluetooth: RFCOMM ver 1.8
[ 42.412000] eth0: no IPv6 routers present
I also noticed that there is padlock icon on top of the Hangar folder and I clicked it on the properties tab and permissions and and it says that I am not the owner and I can not change permissions. Hmm. I really am not familiar with the commands using terminal and the manual helps but am not that familiar and comfortable with typing commands that much. Here is less /etc/passwd command and this what it says:

Quote:

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
avahi-autoipd:x:104:110:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/bin/fals
e
avahi:x:105:111:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
cupsys:x:106:113::/home/cupsys:/bin/falsehaldaemon:x:107:114:Hardware abstraction layer,,,:/home/haldaemon:/bin/false
hplip:x:108:7:HPLIP system user,,,:/var/run/hplip:/bin/false
gdm:x:109:118:Gnome Display Manager:/var/lib/gdm:/bin/false
mapmaker:x:1000:1000:Leander Conferido,,,:/home/mapmaker:/bin/bash
beagleindex:x:110:65534::/var/cache/beagle:/bin/false
Hmm. I still can not mount it properly there must be something that I am doing wrong. He he. I typed the mount command again and it says:

Quote:

mount: /dev/sda5 already mounted or /home/mapmaker/Hangar busy
mount: according to mtab, /dev/sda5 is already mounted on /home/mapmaker/Hangar
Its mounted right but I can not read/write from this partition.

jlconferido 06-25-2007 04:43 PM

I tried the dmesg | tail command and it says:

Quote:

mapmaker@mapmaker-desktop:~$ dmesg | tail
[ 31.460000] Bluetooth: L2CAP ver 2.8
[ 31.460000] Bluetooth: L2CAP socket layer initialized
[ 31.560000] Bluetooth: RFCOMM socket layer initialized
[ 31.560000] Bluetooth: RFCOMM TTY layer initialized
[ 31.560000] Bluetooth: RFCOMM ver 1.8
[ 38.652000] NET: Registered protocol family 10
[ 38.652000] lo: Disabled Privacy Extensions
[ 50.936000] eth0: no IPv6 routers present
[ 450.124000] end_request: I/O error, dev fd0, sector 0
[ 450.148000] end_request: I/O error, dev fd0, sector 0
mapmaker@mapmaker-desktop:~$
The last two lines was not there when I last typed the command.

Tuttle 06-26-2007 06:15 AM

Quote:

Originally Posted by jlconferido
The last two lines was not there when I last typed the command.

/dev/fd0 is your floppy disk drive.

Tuttle 06-26-2007 06:30 AM

Quote:

Originally Posted by jlconferido
Hmm. I still can not mount it properly there must be something that I am doing wrong.

Okay, we got it to mount in the right place at least.

did you notice this line?
Quote:

mapmaker:x:1000:1000:Leander Conferido,,,:/home/mapmaker:/bin/bash
it means you are user (and group) 1000

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
now umount the partition:

Code:

umount /dev/sda5
now make sure the folder "Hangar" is owned by you (just incase it isn't already):

Code:

sudo chown 1000:1000 /home/mapmaker/Hangar
now remount the drive with this command:

Code:

mount /dev/sda5
It will mount this way after a reboot too (see man fstab)

stealth_banana 06-26-2007 10:34 AM

You are using ubuntu, you could just use the pmount command.

pmount /dev/sdax

jlconferido 06-26-2007 11:39 PM

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:

mapmaker@mapmaker-desktop:~$ umount /dev/sda5
umount: /dev/sda5 mount disagrees with the fstab
mapmaker@mapmaker-desktop:~$
And when I mount it it says:

Quote:

mapmaker@mapmaker-desktop:~$ mount /dev/sda5
mount: according to mtab, /dev/sda5 is already mounted on /garage
mount failed
mapmaker@mapmaker-desktop:~$


All times are GMT -5. The time now is 06:00 PM.