Hey,, where's my C Drive?

After a long while slowly getting used to Linux I suddenly realised that I haven’t got a C-drive - and that’s really a big problem for me because it means I haven’t got a D drive either - and that’s where I wanted to save my big files (raw photo images).

This has now got my attention because I have built this new system (OS 11.1 and KDE 4.1) using old bits of computing hardware. I had 2 hard drives - one a reasonable size and reasonably quick one, on which I guessed the system would be built (a C drive equivalent). The other drive is old, small and slow and I wanted to use it only for a swap partition. It will be replaced once I have built a stable system with a much larger faster disk that I have been thinking of as my D drive and on which I can store my raw images.

But when I use dolphin there is no indication of any physical drives at all and so I cannot really state where anything is. So a clumsy replacement of the small old disk with the big fast new one might just totally destroy my system

Moreover, when I look at the ‘Disk Information’ in My Computer it seems that the larger of my 2 disks (on which I expected the system to be installed) seems to contain only a folder called /usr (or is this the name of the device? No, surely that’s /dev/sda ?). The small old drive contains only a folder called / - but when I open it in a new konqueror window, it seems to contain all the key system folders that one finds in /root

This is not what I expected at all.

Can somebody tell me how I cab easily view what partitions, folders and files are on each of my 2 drives?

Open a konsole and post the output, as root, of:

fdisk -l

There you’ll see your drives and partitions, then:

cat /etc/fstab

You’ll see what and where’s everything mounted.

That’s nice and easy guidance to follow, but the output is such that I still cannot be sure that there is no vital data on the 2nd drive, which I want to replace. I have some further questions, if you don’t mind, based on the output from the two commands, which is:

LINEAR-1:/home/tony # fdisk -l

Disk /dev/sda: 61.4 GB, 61492838400 bytes
255 heads, 63 sectors/track, 7476 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb7b2b7b2

Device Boot Start End Blocks Id System
/dev/sda1 * 2 7476 60042937+ 83 Linux

Disk /dev/sdb: 40.0 GB, 40037760000 bytes
255 heads, 63 sectors/track, 4867 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1d161d15

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 4662 37447483+ 83 Linux
/dev/sdb2 4663 4867 1646662+ 5 Extended
/dev/sdb5 4663 4867 1646631 82 Linux swap / Solaris

LINEAR-1:/home/tony # cat /etc/fstab
/dev/disk/by-id/ata-MAXTOR_4K040H2_672123866134-part5 swap swap defaults 0 0
/dev/disk/by-id/ata-MAXTOR_4K040H2_672123866134-part1 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/ata-IC35L060AVV207-0_VNVB05G2R4SMZH-part1 /usr ext3 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

Am I correct in thinking that the file system root is ‘/’ and that it is on dev/sdb?

If so, how can I move it to dev/sda so that I can easily replace dev/sdb?

Where is my /home/tony folder?

How do I work out how much space is used on each of these partitions? Disk Information in my computer shows usage at the disk level, not at the partition level.

Does it all matter? Is there any advantage to me putting my photo collection master archive on a separate drive? And how wold I do that anyway?

What happens when my home folder has consumed all the space on dev/sda (assuming that that is where it is)? Does the system automatically ‘spill over’ onto dev/sdb and write data files there until all that space is consumed?

If so, doesn’t this dramatically increase the risk of data loss? One of these 2 disks is going to fail some day. I assume that data is written in non-contiguous sectors using some algorithm defined by the files-system architecture. This could result in every file having sectors on both drives. By having data files that span across 2 drives, failure of either drive means total loss of all those files. By ensuring files are only on one drive, loss of that drive will not affect files on the other drive. Or am I talking bovine ordure here?

Yes, the installer has put / on sdb, and /usr on sda. /home is part of /, if it isn’t given a partition of its own so it’s on sdb too. The installer did this on the basis of the sizes of the disks. Unfortunately it wasn’t smart enough to know of your plans for sdb.

No there isn’t spillover when a partition fills up of the sort you surmise. When a partition fills up it fills up. (There is LVM, but that is another story not relevant at the moment, and you would have had to set it up at install anyway.)

My advice would be to reinstall openSUSE, this time taking control by using the expert partitioner so that you can put both / and /home on sda. 60GB is sufficient for that, give 20GB to / and the rest to /home.

FYI, if you want to find out what partition a particular directory is in, do something like this command:

df /home/tony

PS: There is another way to get a setup closer to your final goal, and that is to disable sdb during installation. Then you will pretty much automatically get /, /home and swap on sda. That swap on sda isn’t a big deal, it will only 1-2GB max, and swap is a last resort anyway so it doesn’t matter that much that it’s on the same disk.

<Gulp>
I suppose it’s good to learn this now, rather than in a week’s time when I have transferred all my stuff from Windows to this system.

A little tourist info. please:

What is significant about /usr that the installer decided to put this on a separate drive to /?

If I re-install, with sdb not connected, /home will be on /sda (obviously) but what directory(ies) will be on /sdb, once it is connected and detcted by the kernel? You can see I still expecting to address it as D:\something! Because individual drives are not identified in the file managers (and are really irrelevant I suppose to Linux), how will I ever be certain that my files are being written to /sdb?

Finally, what do I do to clean up /sdb in preparation to re-installing suse 11.1? If I don’t do anything, install will get confused, I’m sure. I suppose this can only be done when I have booted from the install DVD because otherwise I’ll be in danger of operating on my own brain (which, I’m told, is quite successful until you get to the mo…

No idea why the installer split it up that way, perhaps on the basis of distributing the partitions to give you more room in / and hence /home.

If I re-install, with sdb not connected, /home will be on /sda (obviously) but what directory(ies) will be on /sdb, once it is connected and detcted by the kernel? You can see I still expecting to address it as D:\something! Because individual drives are not identified in the file managers (and are really irrelevant I suppose to Linux), how will I ever be certain that my files are being written to /sdb?

None. sdb will not be assigned to anything. To do anything with it, you have to go into the partitioner in YaST and you can mount the partitions on it, or rebuild the partitions.

Finally, what do I do to clean up /sdb in preparation to re-installing suse 11.1? If I don’t do anything, install will get confused, I’m sure. I suppose this can only be done when I have booted from the install DVD because otherwise I’ll be in danger of operating on my own brain (which, I’m told, is quite successful until you get to the mo…

You should physically disconnect the drive cable before installing. It’s not enough to disable it in BIOS because Linux can still detect and access it.

Since you were going to replace sdb anyway, I suggest you don’t muck with it anymore. Otherwise you will have to migrate any data you have on it later. As it is you will have to migrate /home off sda when you get your big disk for sdb.

You might want to read up on the Unix/Linux concept of mounting filesystems, and how they form a tree. No addressing physical drives, it’s all one tree. Try the rute guide to linux, search for rute guide linux.

I had similar problems when I made the switch many years ago. It would still be wise to post the output of /etc/fstab.

I have a hard time believing the Suse installer would put /usr on a separate hard drive unless the primary hard drive (/dev/sda) were too small to hold an entire system. But stranger things have happened. It’s not exactly for newbies, but you can do custom disk partitioning from within the Suse installer. Simply tell Suse to put “/” on /dev/sda and /home/Toni on /dev/sdb. Then you can save all your raw camera images to a folder in /home/toni, like /home/toni/raw_camera_images.

Or if you prefer not to make your home folder the entire second drive, you can simply make /dev/sdb mount onto a folder in your home folder (this is why the output of /etc/fstab would be helpful). Assuming there is a valid filesystem present on /dev/sdb, you could create a folder called ‘raw’ in your home folder and add the following line to /etc/fstab:

/dev/sdb /home/toni/raw defaults,users 0 0

Everything in Unix/Linux is a file. That was one of the hardest things to wrap my head around when I switched to Linux ten years ago. If you’re stuck on physical devices, you could change /home/toni/raw to /mnt/drive_d. /mnt was the place where you mounted “external” devices like your CD or DVD drive, or a Zip drive. Nowadays those things are usually auto-mounted and are accessed in the /media folder. Still, /mnt can serve as a useful transitional bridge for former Windows users who miss accessing all their separate storage devices via C,D,E, “/etc.”

In linux there is no “C” drive, or any other windows terminology for labeling disk drives.
But there is something simular, in linux primary drives are labeled HD/SD (Heard this means Hard drive/ Sata drive) A
Secondary drives are usually labeled HD/SD B C and sofourth are usually CD drives, external hard drives, DVD drives etc.
Then there are other things to consider like primary drives with numbers (SD/HDA1) these are partitions on the main drive, SD/HDA1 usually is root, SD/HDA3 is usually home
SD/HDA5 is often Swap space.
But this varies for each linux distro, in my case my CD/DVD drives are labeled SR0, 1 I assume SR means Sata removable or some crap like that.
OpensSuse labels my primary drives as SDA, and CD/DVD drives as SR.

Aha! Now we get to the real issue: this is just what I guessed, looking at what happened when I put a 2nd hard disk into another Linux machine that I use. So, assuming I’ve got a basic install working with just /dev/sda - and all openSUSE placed there (obviously) - can I then do an equivalent of fdisk in YAST on dev/sdb, destroy its partition table (or whatever it’s called), define and name a partition - say, FRED? But then how do I actually use FRED - surely I need a part of the file tree structure to be mounted there (or is it the other way round - FRED to be mounted on part of the tree structure?)?

Since you were going to replace sdb anyway, I suggest you don’t muck with it anymore. Otherwise you will have to migrate any data you have on it later. As it is you will have to migrate /home off sda when you get your big disk for sdb.

Yes, quite correct. In fact, having discovered that one of my feet is bleeding from a bullet wound, I think I am going to bite said bullet (partly in a fit of pique) and start all over again, wiping both disks. This raises a question in my mind, on which I invite some advice:

I’m now thinking of using the big SATA disk (from my Windows machine D drive) as sda, with / on it, because it will run a little quicker than my current PATA (133) 60 GB sda - because of transfer rate and because it has a much larger buffer. So my system will run a little quicker, both to start up and to load applications on demand. But 60 GB at /dev/sdb isn’t going to hold my raw image files plus my collection of music snatched from FM broadcasts. Both of them are probably therefore going to have to be in /home/tony on /dev/sda. But I don’t want 60 GB of sdb sitting there enjoying a nice quiet spin-free holiday. What part of the file system tree should I put on there, without defeating the idea of exploiting as much as possible of the fast SATA drive at /dev/sda?

You might want to read up on the Unix/Linux concept of mounting filesystems, and how they form a tree. No addressing physical drives, it’s all one tree. Try the rute guide to linux, search for rute guide linux.

Excellent advice. Starting tonight.

OK; this is what I have - I trust I have used the correct command (as user, not root):

tony@LINEAR-1:~> cat /etc/fstab
/dev/disk/by-id/ata-MAXTOR_4K040H2_672123866134-part5 swap swap defaults 0 0
/dev/disk/by-id/ata-MAXTOR_4K040H2_672123866134-part1 / ext3 acl,user_xattr 1 1
/dev/disk/by-id/ata-IC35L060AVV207-0_VNVB05G2R4SMZH-part1 /usr ext3 acl,user_xattr 1 2
proc /proc proc defaults 0 0
sysfs /sys sysfs noauto 0 0
debugfs /sys/kernel/debug debugfs noauto 0 0
usbfs /proc/bus/usb usbfs noauto 0 0
devpts /dev/pts devpts mode=0620,gid=5 0 0

Comments?

Yes, you guessed correctly. A partition must be mounted somewhere on the tree. The directory the partition is mounted on is called the mountpoint. Once mounted, the storage in the partition is integrated into the filesystem and you simply address files on it by the pathname. No physical device names needed to get at the file. You can see that this makes it easier to move files to different storage locations without having to change pathnames. Even network filesystems are mounted onto the tree and the use of the network becomes transparent.

You can do all the needed tasks from the YaST partitioner. But FYI these are the CLI utilities that do the various tasks:

fdisk - edit partitions
mke2fs - create an ext2/ext3 filesystem in a partition
(and counterparts for the other Linux filesystem types)
mkswap - initialise a swap partition
mount - mount a partition
umount
swapon - activate a swap partition
fsck - check an umounted partition for consistency
(this is actually a frontend for filesystem specific fsck programs)

There are also many other related utilities like tune2fs and so on. The man pages for each utility will mention them in SEE ALSO.

As for what to do with sda and sdb, you will probably get more performance by exploiting the parallelism. Put the system (/) on one and /home on the other. Say / on SATA and /home on PATA.

Edit: I realised you didn’t say how big the SATA disk is, I assume much larger than the PATA, and you did say that 60GB was insufficient for /home. So correcting what I just wrote: You could assign PATA to / and SATA to /home. But see below. Or just forget about sdb, I don’t think you would lose much performance having both / and /home on it, and I suspect the SATA disk is several times faster than the PATA disk as it is. And you’ll save a few watts of power.

But be careful of one thing. In mixed SATA/PATA systems some BIOSes will give different assignments for the primary drive, depending on whether the PATA is connected. This can cause bootloader issues later on, e.g. sdb goes offline, and then the system won’t boot from sda. If you can ensure via BIOS settings that the primary drive is unambiguously SATA, whether or not the PATA is connected, you can avoid those issues.

You should do this during install:

> Select Create new partitioning layout (or whatever it says in english)
> Select Expert
> In the next screen you can see your drive(s) and partitions. If you don’t have any sensible info in the drive(s) you are safe to select partitions and delete them. Once done:
> Create a new partition (all primary as you only need three in that drive) at the begining of the drive, 2GB size and: filesystem: swap and mount as swap
> Create a new partition, say 10GB, filesystem: ext3, mount in /
> Create a new partition, size: rest of drive, filesystem: ext3, mount in /home

You should be ready to install.
With the other drive you just have to go to Yast, or while installing in the same screen as up here, and partition to your own will, say just one partition, format it as ext3 and mount it wherever you want, e.g. /home/your_user/Data

Hope that helps.

[edit]
Oh, kenyap beat me for a few :slight_smile:
And yes, if you install /home in a different drive it should improve performance.
[/edit]

These last 2 posts have been really helpful - thanks. I understand what you are saying about mixed SATA/PATA systems - I actually had the probelm on my main Windows production computer which I have has to rebuild as all SATA/RAID plus other drives

I just had a play with this on my other, ‘production’, SUSE system (wow! talk about bad practice…) into which I installed a 10 year old 4 GB PATA drive I found at the local recycle centre (i.e. rubbish dump). In YAST I was able to delete the existing Win FAT32 partition, create an ext3 partition and then took the option to mount it - BUT YAST gave me only these 3 options for mount point: /usr, /tmp and /local. I couldn’t set anything like /home/tony/my_NEF_images,

I chose /local as my mount point and notice that in YAST it was identified as local*.

  1. What’s the significance of the * in local*?
  2. Why couldn’t I set a mount point to something in my home directory?

Don’t know about the *.

Not sure why you couldn’t specify an arbitrary directory as the mountpoint, it should also be possible to type it in besides selecting a dropdown choice.

XEyedBear, you might like to know why people use a separate partition for /home. It’s because this makes it much easier to re-install or upgrade your openSUSE system in the future. In a nutshell, the installation can be set to nuke everything on the other partitions except /home so you get a clean start. The trick is, of course, that your valuable data stays on /home and is preserved.

xeyedbear
Have a read of this: General overview of the Linux file system.
It expalins in general terms about mount points, partitions. etc and should probably be a must-read for most new linux users.

OK, I got it - that’s another important step forward in my understanding. Thanks.

This ability to continue to maintain my SUSE system, while protecting my data at the same time (and I have a lot of it) is important. Having looked briefly at the other distros. I have found that SUSE (the combination of product and support) is a good enough solution to my needs so there is no point in looking elsewhere and I’m expecting many more releases from SUSE - hopefully Novell will be able to maintain its corporate commitment to continue to fund this support system

Good pointer - thanks.I remember back in 1981 being given a week-end to learn and understand PC-DOS, including fdisk (before the PC/XT was announced); that’s about all it took. The Linux file system appears, at first sight, to be slightly more involved than that implemented in DOS. On closer examination however, it is clear that the Linux file system is …well, vastly more complex!

Yes, you are quite correct, but the results I get are not what I expected, based on previous advice in this thread. Here’s the story so far:

I was able to format a partition /dev/sdb1 on this 2nd drive and mount it is /local*. I was able to place files in the folder called /local* - almost filling the drive. The folder then contained 3 sub-folders, including one created by the system called ‘Lost+Found’.

In order to test your advice that I could specify amount point directly I then deleted one of these 3 sub-directories in Nautilus (before realising that deleting the partition would do this for me). This left 2 sub-directories in /local*

In Yast I deleted partition /dev/sdb1 (having to unmount it as required by Yast). I then created a new partition (of the same size- maximum), mounted it at /home/tony/fred Yast posted an error (-2002 ?) when trying to create the partition again - i.e. it succeeded in deleting /dev/sdb1.

When I examined my home directory in Nautilus there was no /home/tony/fred folder - but there was still a /local folder (but not /local*) and it still contained the original 2 sub-directories, even after the partition was deleted!

I repeated the process of deleting, adding and mounting /dev/sdb1. This time the error message from Yast was different. (Sorry, didn’t capture it). Again there is no /home/tony/fred folder but now Nautilus has an icon for something called ‘4.3 GB media’ in the navigation bar - and this media when browsed show those same 2 sub-directories there!. There is a folder /local (not /local*) in the file system. It is empty.

I tried a 3rd time - deleted, added, mount partition, using a smaller size. Yast deleted OK but failed when formatting the partition, with the error msg:

"Failure occurred during following action: Formatting partition /dev/sdb1 (3.49 GB) with ext3.

System error code was -3008

/sbin/mke2fs -O dir_index-j-v’/dev/sdb1’:
mke2fs 141.1 (01-Sep-2008)
/dev/sdb1 is mounted, will not make a filesystem here!

When I attempt to unmount the device (to correct what appears to be the error), Linux tells me it isn’t mounted.

So, what am I doing wrong?

I don’t know. I use the CLI to do this sort of thing. Could be a YaST bug, that it doesn’t really umount the partition. That would prevent you from reformatting it, and all that follows.

One that that would prevent umounting is having a directory or file in the partition in use. Maybe you should close the filesystem browser before you attempt to umount.

Have you applied all package updates available in the Update repo?