Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Hi. My largest partition is currently NTFS, which I thought I could use as my Linux home directory. But when mounted to /home, "useradd -m" refuses to add new user directories. So I want to keep 10GB of that partition for Win/Linux documents and such, and use the other 42 GB for Linux users.
My question is rather easy for most of you: using cfdisk, can I just delete that partition, add two new partitions, then write the table to disk? Right now there's no data on that partition but writing the partition table seems risky--I don't want to mess with any of the other partitions (even though I can just reinstall Linux).
Well of course NTFS wouldn't work right. Not being a posix-based filesystem, it doesn't have native support for *nix style permissions or ownership flags. When a Linux system accesses an NTFS drive, it has to simulate them through various mounting options.
I'm not all that familiar with cfdisk, but I don't see any real trouble with what you want to do, as long as you don't need to touch the other partitions. Things might be trickier though if you exceed the 4 primary partition limit and need to reconfigure the drive with logical partitions. Then you might have to move data around (and basically redo the entire disk). You'll certainly have to update your fstab in any case to account for the re-numbered partitions.
You might have an easier time of it using parted/gparted instead.
In any case, there's never any guarantee when it comes to partitioning and formatting disks, so you shouldn't do anything without proper backups in place. The usual rule of thumb is to never commit to any change unless you have some way to revert back if it doesn't work.
You can't split partitions. You can only create, move, resize, and delete.
There is no risk in creating more partitions--right up the the limit imposed by the hardware and drivers. (The normal wisdom is that SATA allows a maximum of 15, but I don't know if that's still true.)
The only other constraint has already been mentioned..........BACKUP!! (Sorry, it just popped out..)
Logical partitions must work in a continuous chain with the ith partition carries the hard disk address of the i+1th partition.
Therefore if you delete sda7 the space is temporarily dead. The previous sda8, sda9 etc will shift up to sda7, sda8 etc.
You can actually see it occuring inside cfdisk!
If you split the dead space into two and recreate two partitions they would be sda7 and sda8. The previous sda8 and sda9 will be forced down to sda9 and sda10.
This means your logical partition device names will be shifted around.
Sata disks support 15 partitions as standard but the modern Linux kernels, newer than 2.6.28, can put 130 partitions in a Sata disk or even more if required. However not all the partitioning tools can respond beyond the 15th partitions.
I have hda1, a "Dell Utility" partition, which I really don't know why it's there (it came w/ the computer, so I just left it--33MB).
I also have hda2 which is my Windows partition--12GB.
My 3 logical partitions include:
hda5 which is my Linux partition proper--9GB
hda6 which is my Linux swap--1GB
hda7 which is the partition I want change to 2 logical partitions--58 GB
And lastly, I have 8.23 MB of "Free Space" classified as "Pri/Log"
As such, there won't be any "shifting around," if I understand you correctly, since currently there are no partitions following the one I want to change. But if I had one following, you're saying that would be shifted up however many added partitions precede, right?
If you delete hda7 and then recreate hda7 and hda8 then there is no shifting in the partitions.
The 8.23Mb may be the left over from the previous partitioning work. All partition starting from hda5 are logical and the first 4 are reserved primaries. Since you have used up hda1 and hda2 that means you hda3 has been converted to an extended partition holding hda5 to hda7. Any space left can be used for the last primary hda4 or a new logical hda8 depending on where the space is located.
Here is my sda appearing in cfdisk
cfdisk (util-linux-ng 2.17.2)
Disk Drive: /dev/sda
Size: 1500300828160 bytes, 1500.3 GB
Heads: 255 Sectors per Track: 63 Cylinders: 182401
Name Flags Part Type FS Type [Label] Size (MB)
sda1 Boot Primary W95 FAT32 (LBA) 57585.19
sda2 Primary Hidden W95 FAT32 (LBA) 57585.19
sda3 Primary Unknown (B5) 57585.19
sda5 Logical Linux swap / Solaris 1653.29
sda6 Logical NTFS [^F] 57585.19
sda7 Logical NTFS [^F] 57585.19
sda8 Logical NTFS [^F] 57585.19
sda9 Logical NTFS [^F] 57585.19
sda10 Logical NTFS [^F] 57585.19
sda11 Logical Linux ext3 28796.71
sda12 Logical Linux ext3 28796.71
sda13 Logical Linux ext3 28796.71
sda14 Logical Linux ext3 28796.71
sda15 Logical Linux ext3 28796.71
sda16 Logical Linux ext3 28796.71
sda17 Logical Linux ext3 28796.71
sda18 Logical Linux ext3 28796.71
sda19 Logical Linux ext3 28796.71
sda20 Logical Linux ext3 28796.71
sda21 Logical Linux ext3 16458.79
sda22 Logical Linux 16458.79
sda23 Logical Linux 16458.79
sda24 Logical Linux 16458.79
sda25 Logical Linux ext3 16458.79
sda26 Logical Linux ext3 16458.79
sda27 Logical Linux ext3 16458.79
sda28 Logical Linux ext3 16458.79
sda29 Logical Linux ext3 16458.79
sda30 Logical Linux ext3 16458.79
sda31 Logical Linux ext3 8233.51
sda32 Logical Linux ext3 8233.51
sda33 Logical Linux ext3 8233.51
sda34 Logical Linux ext3 8233.51
sda35 Logical Linux ext3 8233.51
sda36 Logical Linux ext3 8233.51
sda37 Logical Linux ext3 8233.51
sda38 Logical Linux ext3 8233.51
sda39 Logical Linux ext3 8233.51
sda40 Logical Linux ext3 8233.51
sda41 Logical Linux ext3 8233.51
sda42 Logical Linux ext3 8233.51
sda43 Logical Linux ext3 8233.51
sda44 Logical Linux ext3 8233.51
sda45 Logical Linux ext3 8233.51
sda46 Logical Linux ext3 8233.51
sda47 Logical Linux ext3 8233.51
sda48 Logical Linux ext3 8233.51
sda49 Logical Linux ext3 8233.51
sda50 Logical Linux 8233.51
sda51 Logical Linux ext3 8233.51
sda52 Logical Linux ext3 8233.51
sda53 Logical Linux ext3 8233.51
sda54 Logical Linux ext3 8233.51
sda55 Logical Linux ext3 8233.51
sda56 Logical Linux ext3 8233.51
sda57 Logical Linux ext3 8233.51
sda58 Logical Linux ext3 8233.51
sda59 Logical Linux ext3 8233.51
Logical Free Space 346637.98
[ Help ] [ New ] [ Print ] [ Quit ] [ Units ] [ Write ]
No more partitions
Create new partition from free space
You will note that cfdisk has an option "quit" at the bottom of the page. Therefore you can delete and create partitions and see how they work out and select "quit" as way to study the behaviour. Until you highlight "Write" and then further confirm with a "yes" you partition table will not be changed.
Here is another case that you can have 128 partitions in a Sata if using gpt partitioning scheme.