LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   having trouble copying files (https://www.linuxquestions.org/questions/linux-newbie-8/having-trouble-copying-files-592456/)

DarkPlexus 10-17-2007 04:18 AM

having trouble copying files
 
here's the story:
i have a 500 gig drive, i partitioned it as follows, for the purposes along side of it.
they're in order from sdx1 to sdx10

5 gig swap (primary partition) sdx1

5 gigs for a fat32 in case i need to use dos again for whatever. sdx5
(btw, why do my partitions jump from 2(extended partition) to 5?)

50 gigs for fedora 7 (im using f7 at the moment)
i just want to put the installed system here, apps, etc .. sdx6

150 gigs to music/video/etc sdx7

100 gigs to games or my own files( but everything is my own files...) sdx8

60 gigs for storage for fedora 7... sdx9
(mostly used as a backup of things that in case i need to wipe the 50gig, i have these files ready to just install right away and stick them back onto my OS )

25 gigs , fat32..sdx10
for the same thing above, but for my windows OS
(by storage i meant all the install.exe for app's and such so if windows needs a fresh install, this is where i go to put things back lol)
only 2 fat32 part's, 1 swap, and the rest are all ext3

okay now.... that's what i want to do with my hard drive.. i am finding out it's a big possibility that this setup might not be possible.. i think.

well now my problem is that i've been putting folders on my desktop
(things like oldC, oldD, oldE, oldF, etc...)
these resemble my old fat32 partitions from when i was using windows
i have my new hard drive completely blank, partitioned as above.
i mount my other hard drives to these folders above.. oldC, etc
i also make another set of folders on my desktop, newC, newD,
and these resemble the root drives i want to just copy and paste my old stuff onto, and then i'll take out what's usable and not from there.

i mount my old hard drives to the folder that resembles it
i do the same with the new hard drive.
when i try to copy and paste, i get access denied
i figure out it's because the owner of the folders that i mounted drives to..are owned by the root, and uhh i don't plan on becoming root user every single time i want to make an adjustment to the contents inside these folders, i know how to using the root shell, but that's ridiculous.

soo there's my problem.. somebody enlighten me about how to use linux in this manor lol

i tried moving all the folders to my home folder cuz i read somewhere that changes things, but eh.. same result, as soon as i mount to a folder, that folder is out of my control for normal user operations.

i want to save all my personal files somewhere else besides that 50 gig partition that i plan on reinstalling fedora 7 onto, in case i need to wipe/format/etc the drive for ..whatever.. i am learning after all ; ) accidents happen heh.

bpalmer 10-17-2007 09:49 AM

A command that may be useful for you is:

Code:

fdisk -l /dev/sda
Replace sda with whatever the disk is named. This will show a very nice layout of all your partitions, blocks, offsets, and known filesystems. It might be easier to explain things with that diagram in the future. :)

As for your access problem, you need to change the owner id or the group id of the mounted volumes.

For example, when I mount a network share onto my local machine:

Code:

mount -t smbfs //FILESERVER/stuff /home/bill/stuff -o uid=bill,gid=bill,credentials=/etc/FILESERVER.smbpass
The bolded portion is what you are interested in. ;)

man mount for further details.

DarkPlexus 10-17-2007 04:16 PM

hmm okay, i figured out i need to put my login username after uid and gid so it says im the owner

however when i try that with any of my ext3 file systems it gives me an error which i can find in my dmesg stuffs which says "Unrecognized mount option "uid=500" or missing value"

also, when i type in unmount it says "-bash: unmount: command not found"
so how would i unmount something too? i see people using this command but it wont do anything usefully when i try it lol

and here's my fdisk stuffs, i need to be able to specify read only on some vfat drives and i guess read/write is already default otherwise..

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 653 5245191 b W95 FAT32
/dev/sda2 654 9729 72902970 f W95 Ext'd (LBA)
/dev/sda5 654 6099 43744963+ b W95 FAT32
/dev/sda6 6100 8394 18434556 b W95 FAT32
/dev/sda7 8395 9729 10723356 b W95 FAT32

Disk /dev/sdb: 20.4 GB, 20490559488 bytes
255 heads, 63 sectors/track, 2491 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 153 1228941 82 Linux swap / Solaris
/dev/sdb2 154 2491 18779985 f W95 Ext'd (LBA)
/dev/sdb5 * 154 1815 13349983+ 83 Linux
/dev/sdb6 1816 2491 5429938+ b W95 FAT32

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 653 5245191 82 Linux swap / Solaris
/dev/sdc2 654 60801 483138810 5 Extended
/dev/sdc5 654 1306 5245191 b W95 FAT32
/dev/sdc6 1307 7833 52428096 83 Linux
/dev/sdc7 7834 27414 157284351 83 Linux
/dev/sdc8 27415 40468 104856223+ 83 Linux
/dev/sdc9 40469 48301 62918541 83 Linux
/dev/sdc10 48302 51565 26218048+ b W95 FAT32



----
i found a weird solution using chmod and making the folder owned by root to be writable by anybody.. but i think this is more of a hack type of thing than something standard or uhh.. i dono how to say it
i would rather know how to set the owner when i simply use the mount in the terminal...
----
^^^^ to set the ownership when im mounting ext2 and 3 ^^^^
i already found out how to do vfat's from bp's first post

ShellyCat 10-17-2007 06:55 PM

Regarding: "-bash: unmount: command not found"
The correct usage is umount, not unmount.

Regarding: (btw, why do my partitions jump from 2(extended partition) to 5?)
Because the primary or extended partitions will be numbered 1-4 (whether you bother to create 4 primary/extended partitions is irrelevant), the numbers 1-4 are not used for logical volumes...logical volume numbering automatically starts with the number 5.

As for the old folders you are trying to copy, are those on partition(s) that also contain Windows? What filesystem are the files you want to copy contained in? As far as I can tell, Linux will only let root user read, because it recognizes that someone else owns those files (or rather, it can't find the ownership).

Unfortunately, you may have to log in as root. I think it is impossible to convert from NTFS to FAT without destroying data (at least within Windows itself). You may want to research tools for Windows on the Internet to see if there are any that will let you change the filesytem type, if those original filesystems are of type NTFS.

I still don't know if that will solve the problem. Also, dare I say it, try asking on a Windows forum?

bpalmer 10-17-2007 07:33 PM

To mount a drive read-only, pass ro as an option to -o like you did with uid and gid.

NTFS partitions will be mounted read-only automatically. If you NEED NTFS write support, I recommend installing and using the NTFS-3G driver. http://www.ntfs-3g.org

Shelly, by passing the uid and gid like I explained in my last post, you can change the effective permissions of the data in the mounted volume. There's no reason to ever have to work with files as root. :)

DarkPlexus 10-17-2007 09:18 PM

uhhh i don't have any ntfs, where anybody sees those in my fdisk list is beyond me.
i'm aware i have to get extra things to work with nfs too, but i never wanted ntfs cuz i can't use dos with it.

umount works.. thanks a lot, i found out i've been misreading it and "seeing" that word was unmount whoever i saw it in help files on my system and other places...

i'm simply trying to copy files from a fat32 partition, into a ext3 partition
but when i mount the ext3's they are as the owner root, instead of me
since i don't want to work in a terminal all the time to move or manage or whatever my files.

i just don't have the options set correctly for the ext3 file system to set who owns the folder so they can write into it. and i've been all over the help files and stuff, i just don't understand what to put in there to get where i want to be lol.

and as for what files i'm copying, they're nothing to do with the windows system itself, they're just my personal file that iv'e collected along the way from using windows

i was using windows98, that's on sda1
i'm using fedora, that's on sdb5

once i figure out how to correctly mount my drives, i'll salvage all my old files that i want out of my old partitions and move them to my new faster drive. i don't use windows anymore, but i have files i want scattered all over every partition.
------
i found out how to use chown to change ownership to solve my prob for now...however i still haven't figured out mount yet lol
once i figure out what things mean and stuff i'll set up my fstab and that's probably it.. i'll have everything worked out lol

bpalmer 10-18-2007 09:53 AM

Quote:

Originally Posted by DarkPlexus (Post 2927942)
i was using windows98, that's on sda1
i'm using fedora, that's on sdb5

As root:
Code:

mkdir /home/YOURUSERNAME/win98 /home/YOURUSERNAME/newdrive
mount -t vfat /dev/sda1 /home/YOURUSERNAME/win98 -o uid=YOURUSERNAME,gid=YOURUSERNAME
mount -t ext3 /dev/whatever /home/YOURUSERNAME/newdrive -o uid=YOURUSERNAME,gid=YOURUSERNAME

Change /dev/whatever to the ext3 partition you mentioned and replace YOURUSERNAME with your user's name.

After running those commands, you should have "win98" and "newdrive" folders in your Home folder.vJust drag and drop away! Remember to hold Shift when dragging if you want to MOVE the files, not copy them.

Notice that, even though those folders are owned by root, they become owned by YOUR user when the partitions are mounted into them. ;)

Let us know if you have problems!

DarkPlexus 10-19-2007 03:44 AM

hmm well i already tried that the time above.
(it worked great when i mount my vfat, but it error's on any of my ext's)

here is what the error message prints back to me:

mount: wrong fs type, bad option, bad superblock on /dev/sda7,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so


and the last line of dmesg says:
EXT3-fs: Unrecognized mount option "uid=500" or missing value

perhaps i'm supposed to set something somewhere first before i can just do uid things with these?


thanks for putting with all this o.O you been a big help through it all.

DarkPlexus 10-26-2007 03:01 PM

anybody willing to give any more input on my problem?
i still haven't figured this part out...

ShellyCat 11-11-2007 07:13 PM

Quote:

Originally Posted by bpalmer (Post 2927864)
Shelly, by passing the uid and gid like I explained in my last post, you can change the effective permissions of the data in the mounted volume. There's no reason to ever have to work with files as root. :)

at bpalmer:

Derrrr....thanks. Maybe I should have read your answer closer before. That will help me on my dual-boot system, too.

at DarkPlexus

This may be a longshot, but at the mount command, try actually typing out the names of the user and the group (instead of the ID), as in example:

uid=Bill (or whatever your username is)
gid=users (or whatever group you belong to)


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