LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Lost Windows/C (https://www.linuxquestions.org/questions/linux-hardware-18/lost-windows-c-406460/)

NikToo 01-22-2006 05:16 AM

Lost Windows/C
 
I reinstalled SUSE 10 last night and when looking at it now I saw that windows/c (my Windows partition) isn't visible. How do I fix that?

acid_kewpie 01-22-2006 05:31 AM

assuming it's still really there, add an entry to /etc/fstab, e.g.
Code:

/dev/hda1  /windows/c    auto  defaults 0 0

NikToo 01-22-2006 06:01 AM

Brilliant, thanks. It's still there, on it now in fact (I know, heresy, but my girlfriend wanted the computer). It's on the main bootdisk though, so would I use hda0 instead?

snowtigger 01-22-2006 06:28 AM

The number refers to which partition it is on. There is no '0' partition

Example,
hd - this is usually drives on an ide bus
a - this means it is the primary master
1 - the partition number

So something like 'hda7' means it is an ide device, its is the primary master and the partition number is 7.

'hdb1' would be and ide device, it is the primary slave and the partition number is 1.

But when you get to something like a cdrom drive you don't get the numbers.
Example, a cdrom drive on the ide bus at secondary master would be 'hdc'.

To find which one is your windows partition as root do 'fdisk -l'. This will give you a list of the partitions on your harddrives. In the column labeled 'System' it will tell you what type it is. Windows will be either a NTFS or FAT type.

:)

NikToo 01-22-2006 11:25 AM

Aha... Thanks. Learn something new every day with this Linux. I'll get this Linux up and running. It's not easy but when it works it's great.

snowtigger 01-22-2006 11:27 AM

Glad I could help.

:)

NikToo 01-22-2006 11:50 AM

Changed it and nothing happened. :( I changed 'hda1' to 'sda1' as that's how they all seem to be referred to as (tried it with 'hda' first though). Should I change something else?

(And the Windows drive is HPFS/NTFS.)

snowtigger 01-22-2006 11:55 AM

Could you post the output of 'fdisk -l' and the contents of fstab, then we can see how things are looking.

:)

NikToo 01-22-2006 11:59 AM

Here's fstab:

Code:

/dev/sdb1            /                    reiserfs  acl,user_xattr        1 1
/dev/sdb3            swap                swap      defaults              0 0
/dev/sda1            /windows/c          auto      defaults              0 0
proc                /proc                proc      defaults              0 0
sysfs                /sys                sysfs      noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts              /dev/pts            devpts    mode=0620,gid=5      0 0
/dev/sdb2            /data1              auto      noauto,user          0 0
/dev/sdb4            /data2              auto      noauto,user          0 0
/dev/dvd            /media/dvd          subfs      noauto,fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0
/dev/cdrom          /media/cdrom        subfs      noauto,fs=cdfss,ro,procuid,nosuid,nodev,exec,iocharset=utf8 0 0
none                /subdomain      subdomainfs noauto        0 0

The third line is the one I added.

And here's fdisk -l:

Code:

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1      24320  195350368+  7  HPFS/NTFS

Disk /dev/sdb: 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/sdb1              1        2611    20972826  83  Linux
/dev/sdb2            2612        5222    20972857+  83  Linux
/dev/sdb3            5223        5484    2104515  82  Linux swap / Solaris
/dev/sdb4            5485        8095    20972857+  83  Linux


snowtigger 01-22-2006 12:08 PM

:confused: well fstab looks correct.

Have you created the mount point for it. In other words if you do 'ls -alh' in '/' are is there a directory called 'windows' then inside that one 'c'

:)

NikToo 01-22-2006 12:25 PM

Nope, there's no windows folder at all.

snowtigger 01-22-2006 12:27 PM

That is where the problem now lies. You need to create the directories to mount to.

:)

NikToo 01-22-2006 12:37 PM

So just go in and do "New folder" and call one "windows" and inside create one called "c"?

NikToo 01-22-2006 12:41 PM

Now it's showed up, but I can't make it accessible to my default user as it's "on read-only disk".

Thanks for your help, Snowtigger. It's much appreciated.

snowtigger 01-22-2006 12:45 PM

Yes that is correct. You should do this as root and make ensure they have the permissions of Owner=RWX and the Group and Other=RX. The owner and group should be set to root.

To do this from the cli do 'mkdir -p /windows/c'

:)

snowtigger 01-22-2006 12:50 PM

Depending on what kernel you are running you may not get write access to an NTFS partition.
NTFS is not a native format to linux. It is possible to write to it and work is being done to improve this, but it is still a bit flakey.

:)

NikToo 01-23-2006 12:44 AM

Fantastic, thanks. That's solved it all.

NikToo 01-25-2006 08:18 AM

I think I spoke too soon. I can see windows/c as root, but when I go in as a user the folders are all locked. If I make one available, the subfolders don't change. Is there a way of changing them all?

I tried putting myself into the root group, but that didn't change anything.

haertig 01-25-2006 10:02 AM

Quote:

Originally Posted by NikToo
I can see windows/c as root, but when I go in as a user the folders are all locked.

Change your /etc/fstab line from this:
Code:

dev/sda1            /windows/c          auto      defaults              0 0
to this:
Code:

dev/sda1            /windows/c          auto      ro,umask=0222        0 0
This will mount it as read-only for everyone, not just root. To make your fstab change effective you will have to remount the filesystem:
Code:

# umount /windows/c
# mount /windows/c

Make sure nobody is doing anything in that filesystem when you try to unmount it, otherwise you will get a "filesystem busy" error.

You can also remount a filesystem like this:
Code:

mount -o remount /windows/c
However, the remount option can cause some strange things to happen with SAMBA mounts, is not supported for some filesystem types, so I generically avoid it and just use umount followed by mount.

NikToo 01-25-2006 10:26 AM

Thanks, that's actually solved it. What does the ro and umask=0222 do that it didn't previously do?

haertig 01-25-2006 11:13 AM

"ro" means mount it "read-only". This is probably what you want for an NTFS filesystem. I don't trust writing NTFS from Linux. It's still considered experimental. If it's a FAT32 filesystem. you can substitute "rw" for "read-write". Linux does just fine writing to FAT32.

"umask=0222" says make everything readable and executable (but not writeable) by everyone. Without the umask part, it would only be accessible by root (the userid that mounted it). This is what you ran into - root could see it, but others couldn't.

Read up on permissions, octal, and masking if the above is not understandable. "man umask" is a start, but will be pretty cryptic if you don't already know what it is talking about. Great manpage, huh?!

A high level overview is "set the umask to the opposite of the file permissions you want".

You want permissions (owner, group, other):
Code:

-r-xr-xr-x
and this maps to mode:
Code:

0555
which means you set your umask to "the opposite of" 0555, which is:
Code:

0222
This is only understandable if you understand that "octal 2" = "binary 010" and "octal 5" = "binary 101". Thus "0555" = "101101101" and "0222" = "010010010". Stacking the two binary representations "on top" of each other illustrates how they are "opposites" (one's become zero's, zero's become one's):
Code:

101101101
010010010

Either you already knew this and my explanation is silly, or it's way more than you ever wanted to know in the first place! ;-)

dmartins 01-25-2006 01:43 PM

two other options that are useful, especially if they partition isn't mounted at boot are 'user' and 'users'

user lets any user mount the partition and only the same user (other than root) unmount it.
users lets any user mount the partition and any user unmount it.

again, only really useful if you have 'noauto' as well.

NikToo 01-25-2006 02:00 PM

Aha... So like a hotswappable hard drive?

This is really useful, so thanks a lot. I'm a latecomer to the world of (proper) computing. When I had to choose my career path in the early 90s, computing wasn't all that great. The university courses still had punch card elements. So I went with Political Science... I kept up with computing on an enthusiast level, but never dwelwed deeper into it. Now I'm doing a part time course in Computing, and teaching myself Linux, so hopefully one day I'll have a proper career in computing (albeit almost 15 years late). So everything like this is very, very useful, and it's greatly appreciated.

NikToo 01-26-2006 05:57 AM

Managed to create a FAT32 partition on my Windows drive, and then configured and mounted it successfully. I guess this is why I like Linux: once you get things to work it feels like a real achievement. :)

Now to put my mail folder on it...


All times are GMT -5. The time now is 10:27 PM.