Probably best to explain how disks actually work in UNIX first.
You don't get drive letters in UNIX, drives become special files under /dev/. If you had a disk with three partitions in it, you would get something like
/dev/sda -- the raw disk itself, with the contents of all three partitions. This is the device you use when editing partitions.
/dev/sda1,2,3 -- The partitions inside /dev/sda. These are the things you format and mount.
To partition a disk in Linux, you'd probably prefer the commandline parted tool since it's common, supports several partition types, can do things like moving and resizing of partitions, and has a somewhat verbose built-in help. If you don't have it, you can try fdisk on systems with old-fashioned boot labels, but its abilities are more limited, and you must read its options carefully.
When you mount a disk, it doesn't become a drive letter, it takes over a folder, typically an empty folder. Say you had a folder /mnt/disk inside your root partition, you could do mount /dev/sda1 /mnt/disk to have its contents made available inside /mnt/disk. The root partition itself is mounted by the kernel on boot, because it has to start somewhere. You unmount partitions with umount /dev/sda1 or umount /path/to/folder, but can't do that to a partition that's in use.
Automounting of non-removable disks is typically done through /etc/fstab, a text file containing a list of partitions and where they belong. When the system boots, it will attempt to mount anything in this list lacking the 'noauto' option. If any fail to mount, this is considered a severe error. Here's a fstab from one of my systems:
Once you've partitioned a disk, you format it with the mkfs command. There's actually many different mkfs commands, since there's many different partition types, but they have a lot in common and can be mostly used the same way. For example:
would reformat /dev/sda1 with the ext4 filesystem. Other common Linux filesystems include ext3 and reiserfs.
Encrypting a disk isn't something I've tried personally. There seem to be quite a lot of steps involved, it's not a single command.
Last edited by Corona688; 03-23-2012 at 01:46 PM..
What is the general rule for a divvy of a hard disk, I know that the boot is 20 megs swap is times 2 of ram. I am learning unix
for the first time and at work i cant get this divvy thing down pat yet.
boot 1 to 19999
swap 20000 to 122499 (512 megs of ram)
root 122500 to ?
u ?
u2 ?
... (1 Reply)
What is the general rule for a divvy of a hard disk, I know that the boot is 20 megs swap is times 2 of ram. I am learning unix :)
for the first time and at work i cant get this divvy thing down pat yet.
boot 1 to 19999
swap 20000 to 122499 (512 megs of ram)
root ... (2 Replies)
I had an issue with a second hard disk in my machine. I have a sparc station running solaris 7. It was working fine but now it wont mount on boot up and when you try to mount it manually it gives an I/O error. I tried a different disk as a control which was fine. What I want to know is if my... (3 Replies)
i have recently recieved a new hard drive which i needed for lack of space. i installed a newer version of my previous operating system, suse 8.2. i saved my old drive just in case. anyway this thing only boots sporadically. the person who gave it to me forgot to tell me there was problems with... (2 Replies)
:eek: I use this Solaris to run CMS a call acounting software package for my job. No one could run reports today because it said the this when you logged on
"The following file systems are low, and could adversely affect server performance:
File system /: 99%full"
Can some one please explain... (9 Replies)
hi
I've a fresh installation of SCO 5.0.7 on the IDE hard disk.
For SCSI hard disk I can declare, for example blc disk driver using:
# mkdev hd 0 SCSI-0 0 blc 0but it works for IDE hard disk? (3 Replies)
Hi all,
I'm kind of new to programming in Linux & c/c++. I'm currently writing a FileManager using Ubuntu Linux(10.10) for Learning Purposes. I've got started on this project by creating a loopback device to be used as my virtual hard disk. After creating the loop back hard disk and mounting it... (23 Replies)